Wednesday, January 12, 2011

What is Dalvik, Anyway?

If you have heard much about Google’s mobile operating system, Android, or have been following the recent Oracle lawsuit against Google, you have probably encountered the term “Dalvik”. If Android is “Java based”, what exactly is Dalvik and what does it do?
To understand Dalvik, you must first understand that Android is not Java. Android being “Java based” is a great oversimplification that many in the media and tech news have used to avoid getting too deep into the details. However, Android has never claimed that it was 100% compatible with Java. Java syntax is used to create the source code for Android applications. It is then compiled into Java bytecode.
For those of you not familiar with Java, bytecode is a type of “virtual” machine code. Java programs are turned into bytecode which is then run on a Java virtual machine (VM). The virtual machine is what allows Java programs to run on diverse platforms. It interprets the bytecode and adjusts for the actual hardware.
Android programs take an additional step though. The Java bytecode is converted into Dalvik bytecode. This is because Android does not have a Java virtual machine. Dalvik replaces the Java VM on the Android platform. Dalvik differs from the Java virtual machine in a number of ways. Many of these differences are necessary because mobile phones typically have lower memory and less powerful hardware than the platforms that Java typically runs on.

Read more: Learn computer