Dalvik, virtual machine of Android

Dalvik is the virtual machine for The Java langage for applications of the Google Android operating system.

The name comes from a town in Iceland, from where the creator has origins. Dalvik is produced by the Open Handset Alliance, which includes hundreds of companies
It was created to replace the Java virtual machine because even if its license is GPL2 for the regular version, there is an exception on the mobile version Java ME, which enables Oracle to charge fees on its use.

dalvik

The applications for Android are written in Java, the code is first compiled into bytecode by a regular Java compiler, and then recompiled in a code recognized by Dalvik.
So .class files are converted into .dex file. But a such file holds several classes and is comparable in size to a jar file.
Dalvik does not use the Java class library but an alternative by the foundation Apache, Harmony.

In conclusion, Android does not use the Java ME virtual machine, nor the Java SE library.

Dalvik vs. Java ME

There are differences between the virtual machines, mainly Dalvik runs applications in a separate environment as do browsers, which is safer.

Two statements in the Android documentation summarize the difference between Dalvik and Java Micro Edition:

"Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently."

"The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included "dx" tool."

Also a part of the functions were transferred to the backend, in this case Linux:

"The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management."

Source: Android developper site.

Oracle against Google

On August 12, 2010, Oracle that had acquired Sun in 2009 and thus Java, filed a complaint against Google for infringement of Copyright and patents.
The main purpose of this complaint is the Dalvik virtual machine, which according to the complaint, is using technologies that are covered by software patents that Oracle now owns.
Google responded by saying that the complaint is not founded and also that the author is not Google but the Open Handset Alliance.
The outcome of the case will focus on the validity of software patents allegedly used in Darvik.

We must understand that with the immense popularity of Android (which was sold in August 2010 at a rate of 200,000 copies per day), the virtual machine JME of Oracle can not bring them anything. Android is even ported on devices running other OS such as those of RIM!
But Java would it been chosen by the manufacturers with an operating system subject to royalties?


Resources

Programming technologies Ajax - API - Cassandra - CLI - Cookie - Cover Flow - Dalvik - DFA - Flash - GUI - HTTP code - IDE - JavaFX - JNA - JSON - MySQL - NaCl - .NET - NoSQL - Protocol Buffers - Qt - REST - Servlet - Web 2.0 - WebGL - Webkit - WinRT - WYSIWYG