Why cannot you run standard Java bytecode on Android?

Asked 21-Jan-2018
Viewed 992 times

0

Why cannot you run standard Java bytecode on Android?

1 Answer


0

Because Java uses JVM (Java Virtual Machine) for compile any program and generated standard bytecode or magic code, in another point of view android usesDVM (Dalvik Virtual Machine) for running any applications. Java bytecode is different from android Dalvik bytecode and this bytecode is not executable code for an android application. Because android Dalvik bytecode is first to optimize for make it mobile friendly and JVM bytecode can’t make code mobile friendly.


 Why cannot you run standard Java bytecode on Android?

Generally, Android apps uses different XML file for developing an application, but Java doesn’t use any XML file for running any program. Android DVM uses the dx.jar file for generating Dalvik bytecode but JVM doesn’t use any external file for generating bytecode. These are the main important points that, Java bytecode can’t run on android studio projects.



"Thanks!!! for Reading"