Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a java swing application to work on android

Tags:

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.

like image 227
Peter Avatar asked Mar 05 '11 19:03

Peter


People also ask

Can java swing be used on 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.

Does JFrame work on Android?

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.

What is the replacement for java swing?

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."


1 Answers

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.

like image 96
Brandon Wilson Avatar answered Oct 07 '22 20:10

Brandon Wilson