24

Which edition of Java is being used in Android J2ME or Java SE?

4 Answers 4

19

Everyone is right here, but let me clarify the whole procedure a bit - how it works:

  1. We use ordinary Java compiler from standard J2SE distribution and generate .class files - also known as byte code for Java VM.

  2. Then using tool included in Android SDK (aapt) - we generate, from .class files, .dex files - in other words, Dalvik VM bytecodes.

  3. 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.

Sign up to request clarification or add additional context in comments.

Comments

11

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

thnx jonas you say java is the programing language for the Android SDK.my question is that which edition of java is used in android J2ME or java SE.
@Adil: It's not Java ME or Java SE that is used, it's Android. It's a different compiler and a different virtual machine. So you can see Android as a different Java edition. Android is only using a subset of the Java SE libraries, but uses other custom libraries too.
thnx jonas now i m understand
6

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.

http://en.wikipedia.org/wiki/Dalvik_virtual_machine

1 Comment

"Android Runtime (ART) was included in Android 4.4 "KitKat" as a technology preview. ART replaces Dalvik entirely in Android 5.0 "Lollipop"
0

GNU project "J2SE for Android".

  1. it provides Swing and AWT classes, so you can run J2SE application on Android with this library.
  2. it implements most functions, NOT all.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.