Does android system include JVM? Does android system include JVM? android android

Does android system include JVM?


Programs are commonly written in Java and compiled to bytecode for the Java virtual machine, which is then translated to Dalvik bytecode and stored in .dex (Dalvik EXecutable) and .odex (Optimized Dalvik EXecutable) files.

In short, programs are compiled into JVM bytecode, which is then interpreted into DVM bytecode. Instead of running the compiled Java code, Dalvik compiles it and then translates that code into it's own code. It in some way is a replacement for the JVM.

An alternative runtime environment called Android Runtime (ART) was included in Android 4.4 "KitKat" as a technology preview. ART replaces Dalvik entirely in Android 5.0 "Lollipop".

ART, the Android Runtime, replaced Dalvik in Android 5.0. ART still uses the same .dex files, but they are instead translated into .elf(Executable and Linkable Format) files. This is another replacement for the JVM, as Java code is compiled into JVM bytecode, then translated into DVM bytecode, then translated into an ELF file and executed.

@Chris Thompson does a great job explaining DVM bytecode on Understanding disassembly of Dalvik code.

Sources: Wikipedia / Friends / Experiences


But i didn't understand if android system include JVM

No.

Or DVM is a replacement for JVM?

The Dalvik virtual machine is for executing Android applications compiled to Dalvik bytecode. The Java virtual machine is for executing Java applications compiled to Java bytecode. Whether you consider one to be a replacement for the other is up to you.