• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Porting from Java using swing and awt libraries into the Android

DIONYZUZ

Lurker
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.
 
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.
 
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?
 
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.
 
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.
 
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. =)
 
Back
Top Bottom