I want to run a Java application on Android. It does not have a user interface and embeds Jetty as a servlet containr. It implements a web application that is normally accessed online by its users but I need to run this offline on Android tablets.
Is this at all possible? All I have been able to find is information on how to develop Android apps. I simply want the equivalent of java -jar ...
and any information would be welcome.
There is no equivalent of this in Android. Android uses a DVM instead of a normal JVM, which is based on Apache Harmony.
You would in any case need to recompile the application since the DVM only executes Dalvik-Bytecode which is created from normal Java-Bytecode by the dx
-tool shipped with the Android SDK.
Also, why do you need to run a Server-Application on a tablet device?
You can't normally just run Java code, Android devices don't even have a Java VM. You have to recompile your application and convert it to dex, which is used by Dalvik VM. Whether it is easy to do so or not, depends, of course, on the APIs you use, since Android only has a subset of Java SE APIs.
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