Which edition of Java is being used in Android J2ME or Java SE?
4 Answers
Everyone is right here, but let me clarify the whole procedure a bit - how it works:
We use ordinary Java compiler from standard J2SE distribution and generate .class files - also known as byte code for Java VM.
Then using tool included in Android SDK (aapt) - we generate, from .class files, .dex files - in other words, Dalvik VM bytecodes.
In the end, we compress all those files (.dex + resources) into zip archive which we name as .APK file - kinda Android executable.
So from this point of view - it's clear that Android uses neither J2ME (which runs so called Kylobyte VM bytecodes) nor J2SE (which runs Java VM bytecodes).
But from other point of view, Android is definitely closer to J2SE - since it's based on top of JVM bytecodes.
Comments
Android is not Java ME or Java SE. Android is a different platform and framework but Java is the programming language for the Android SDK. Android isn't using Java Virtual Machine but Dalvik. There is also an Android NDK for C/C++.
3 Comments
Android uses Dalvik
Dalvik is the virtual machine (VM) in Google's Android operating system. Dalvik is thus an integral part of Android, which is typically used on mobile devices such as mobile phones, tablet computers and netbooks. Before execution, Android applications are converted into the compact Dalvik Executable (.dex) format, which is designed to be suitable for systems that are constrained in terms of memory and processor speed.
1 Comment
GNU project "J2SE for Android".
- it provides Swing and AWT classes, so you can run J2SE application on Android with this library.
- it implements most functions, NOT all.