Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Porting java apps to Android platform

I know Java apps can be run in Android. But what I want to know is this: I have a perfectly normal Java app and I want to port it to an android platform. What changes would I need to do to my app in terms of GUI and other code to make it usable in Android? I know Android uses XML file to control the look and feel of its app. So would I need to change my GUI completely?

I just want to know the general overview of how porting may be done. If anyone could point me to right resources, that would be great. Also, for your info I'm a newbie to developing android app, so please be patient with me :)

Update: Both very helpful answers. Thank you!

like image 688
GotAmye Avatar asked Oct 16 '09 00:10

GotAmye


People also ask

Can you use Java apps on Android?

You can do it quite easily as there are many ways to run java apps on android. Specific application called Java Emulators can do it quite easily. These are four most popular java emulators for android viz, JBED, PhoneME, Jblend and NetMite. These are arranged in order of their preference.

Can Java build mobile apps?

Java is an incredibly powerful and well-established programming language with an enormous community and a wealth of libraries and tools that can help anyone build a mobile app. It's easy to learn, has cross-platform capabilities, and it's secure, making it a language of choice for app development.

Can Android Studio run Java files?

Android Studio creates a Java file with skeleton code that you can modify.

Is Android a Java platform?

The Android platform provides Java framework APIs to expose the functionality of some of these native libraries to apps. For example, you can access OpenGL ES through the Android framework's Java OpenGL API to add support for drawing and manipulating 2D and 3D graphics in your app.


1 Answers

The short answer is that you would simply rewrite all of the GUI from scratch, for Android. It simply uses a completely different UI framework. While basically all of the core Java libraries are there, Swing and AWT libraries are not.

If you are looking to translate parts of it automatically, I don't think there is any such tool. You're going to be building a brand new Android GUI.

And really, that makes sense. These frameworks are serving reasonably different platforms and needs (desktop vs. phone). You probably need to be redesigning your app quite a bit to go from a desktop to a phone.

Good news is the non-GUI parts ought to work as-is with no changes, unless they do something unusual. You may have to package third party libraries into your project if they are used by your code.

like image 117
Sean Owen Avatar answered Oct 12 '22 00:10

Sean Owen