I downloaded some 3D games, unzipped them and got .jar files. How can I use these in Android? I have a Galaxy S running 2.1.
Although Android uses java, it doesn't support normal JAR files. Instead it uses an Android specific format called APK. The main difference is that Android does not use the normal Java Virtual Machine, but contains it's own Dalvik Virtual Machine that's optimized for Android.
I'd like to partially disagree with Ryan Conrad & Onik.
I have a Samsung Spica and it came pre-loaded with an app while it was running v1.6 and now running 2.1 (both official Samsung India versions) - called Java ME Apps.
I am running multiple Java apps (meant for non-Android phones) through it.
Both are JAR files and once run via the Java ME app, both run as expected.
So to sum up, there is a way to run JAR apps on Android. I do however, agree with everything else mentioned WRT APKs and Dalvik.
Android doesn't actually even "use" java. The language that the code is written in is Java, but the android SDK takes the compiled bytecode and converts it in to the Dalvik bytecode.
So it is really a misconception that Android runs java. Android runs Dalvik, which the core libraries are based on the Java framework, but the end resulting binary files are not the same, and the virtual machines are also completely different.
Just like the Dalvik VM will not run Java bytecode, the Java VM will not run Dalvik bytecode.
Converting libraries to Dalvik is probably possible, if all the features are available in Android (or additional libraries), but anything that has a Java UI, will not work.
No, you cannot install jar files in android, to install applications from jar we need J2ME support which is not in android phones.
protected by Matthew Read Nov 11 '11 at 17:34
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?