Porting from Java using swing and awt libraries into the Android


Last Updated:

  1. DIONYZUZ

    DIONYZUZ Member

    Hello, I currently have an application using the libraries swing, swing.table, and awt on a java applet that I have running. I want to know what are the steps to get the application running as a native android app. I heard that I could use programs like Phonegap to just release a web based app for multiple platforms, but I am new to Android Programming (so far I just made a Hello Android app). Any advice or if you could point me to another forum to help with this porting. So far I searched swing and awt, but I could not find any useful info. Any help is greatly appreciated.

    Advertisement
  2. jonbonazza

    jonbonazza Well-Known Member

    Unfortunately, UI in android is done entirely different than UI in Java using the swing/awt libraries. There is no concept of a "frame" or "panel," so porting swing/awt code to android isn't really the right approach. Instead, Android should be treated as a clean slate when it comes to UI and you should develop its UI separate from any swing/awt UI.
  3. DIONYZUZ

    DIONYZUZ Member

    Ok so would it be easier to just get rid of all the window sizes, buttons etc and make new ones using xml? Is there something better for a native app than xml?
  4. jonbonazza

    jonbonazza Well-Known Member

    Although it is possible to programatically setup the Activity and its controls, it is best practice and much easier to just use XML. I suggest walking through the tutorials on the Android Developers page to get an idea of how Android apps work. It is a world of difference from Java apps.
    DIONYZUZ likes this.
  5. DIONYZUZ

    DIONYZUZ Member

    Alright I have looked into tutorials and it does seem fairly easy to edit the UI with xml. I am working on an ECG app that will display a graph in realtime, and hopefully I will get it to the point where it can save and load its data. I am doing this for a senior project at my school, so my team is working on the hardware which will transmit the data from Bluetooth into an Android device while I will make this app.
  6. jonbonazza

    jonbonazza Well-Known Member

    Neat. Good luck on your project. If you have any questions on how to do something specific, feel free to make new posts for them. =)

Share This Page