So I built a program in Java using swing for the interface and i didn't realize how difficult it would be to convert it to be used as an android application. Is there any way for me to easily convert or rebuilt the program to be sold in the android market place? If not can anyone point me toward any resources to help build a android.
There is no way you can use swing in android, because android is not based on JavaSE, while swing is. android uses a special java that is designed to run on DVM . Even if their is no compatibility issue. Swing is used for desktop apps which differ in their UI completely from mobile apps.
1 Answer. Show activity on this post. Unfortunately java swing is not supported by android. This means swing classes will not be usable in android environments so classes like JFrame will show up as errors when you move it over to android studio.
Buoy - (buoy.sourceforge.net/) - "Buoy is a library for creating user interfaces in Java programs. It is built on top of Swing, but provides completely new classes to represent UI components. Its advantages include a simpler API, a more powerful event handling mechanism, and much more."
I did the same thing awhile back. Although there is no program out there that I know of to convert it directly. The Java code and the android code are very similar. Since android doesn't use swing's UI it uses XML
based UI. once you get the UI functions of the android app down your Java code can be easily imported.
I am working on converting my Java app into an android app now. Most of my classes imported with no problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With