We have a desktop/web java application and also getting into Android development.
Ideally we would like one app that runs both on desktop and android.
From what we can tell, it's not much possible to run normal java apps on android. But wondering if it can do it the other way? That is, run android apps easily on the desktop (without the user install the sdk or android emulator)?
In a prefect world we'd like one app for both platforms. Realistically though it seems like we're going to have to have one app with two front ends?
Basically you would break your application into at least three projects... one Android project for the Android-specific stuff, one desktop Java project for the desktop-specific stuff and then one Java library project for the common functionality (where most of your real work should be done). Then you can reuse the library project in both the Android and desktop projects.
There are some differences in what is available in the Android environment so you will need to keep an eye on that, but with some good design you should have no problems sharing quite a bit of code between your projects.
Good luck.
Check out libgdx, it may be just what you are looking for. http://code.google.com/p/libgdx/
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