Why cannot you run standard Java bytecode on Android? | Javamazon

Standard Java bytecode Implementation on Android

Dalvik is the process virtual machine (VM) in Google’s Android operating system. It is the software that runs the apps on Android devices. Dalvik is thus an integral part of Android, which is typically used on mobile devices such as mobile phones and tablet computers
Android uses Dalvik Virtual Machine (DVM) instead of the Java VM which requires a special bytecode. Due to this, you cannot execute standard java programs on an Android device. Additionally, Android programs are supported by various XML files like the Android Manifest, layout files, resource files etc. The Android Manifest is especially important, as it contains information on which part of the app can be launched, which is a service or a receiver, what permissions the apps needs, what hardware and software features the app needs, which version of Android is compatible with it etc.We need to convert Java class files into Dalvik Executable files using an Android tool called “dex”.
Technically it should be possible to interpret hotspot byte-code on dalvik vm or dalvik’s byte-code on hotspot, but it will never be efficient (not mentioning elegant) design for a long run. the cost of doing that might become very high especially with respect to maintenance in the future evolution of such a split ecosystem.
Dalvik does not align to Java SE nor Java ME class library Instead it uses its own library built on a subset of the Apache Harmony Java implementation.


Post a Comment