Google’s Android software for Open Handset Alliance raises eyebrows of every Java developer because of its non-standards. Instead of supporting the Sun’s open source efforts on Java, Google went in a different direction and came up with its own JVM named Dalvik which executes Java programs on Android phones. It is neither Java SE, nor Java ME. It is Google’s in house version based on some of Java SE packages, apache commons, httpclient, junit and their own user interface instead of standard AWT, Swing. It also has android.* packages for Telephony APIs, power management and SMS. (List of Androids packages). In a way its similar to the GWT which uses Java as its development language but does not support the full JDK.

The byte code execution is also different. Instead of executing the .class files, Dalvik VM executes the .dex files which are optimized for minimal memory footprint. The dx tool(part of Android SDK) transforms .class files into .dex files.

We have enough problems with Java mobile development already. Not all phones support all the same Java standards, so there is no guarantee that the same software will run on multiple devices, as the “write once, run anywhere” Java tagline promises. Now Android is going to create more problems than solving. With this, programmers will have a new breed of Java to develop mobile applications, those cannot be ported to any device except Android powered phones. We already have enough versions(standards) of Java, why do we need another one?. I don’t think any Java developer is interested in developing the applications in non-standard version, unless you want to win the 10 million dollar prize? It sounds like Google is trying to bribe the Java developers to adopt this non-standard Java with 10 million dollar prize. Well, may be its another Google’s don’t be evil policy -:)

Google tweaked the JVM to improve the performance of applications for the Open Handset Alliance phones. In fact, for the same tactics, Sun sued Microsoft a while ago. Knowing this, how Google managed to get the license from Sun to tweak the JVM? In fact, they didn’t - according to MIT research scientist Stefano Mazzocchi:

But Android’s programs are written in Java, using Java-oriented IDEs (it also comes with an Eclipse plugin)… it just doesn’tcompile the java code into java bytecode but (ops, Sun didn’t see this one coming) into Dalvik bytecode.
So, Android uses the syntax of the Java platform and the java SE class library but not the Java bytecode or the Java virtual machine to execute it on the phone (and, note, Android’s implementation of the Java SE class library is, indeed, Apache Harmony’s!)
The trick is that Google doesn’t claim that Android is a Java platform, although it can run some programs written with the Java language and against some derived version of the Java class library. Sun could prevent this if they had a patent on the standard class library, but they don’t and, even if they did, I strongly doubt it would be enforceable since Android doesn’t claim to be compatible (and in fact, could very well claim that their subset/superset is an innovation on the existing patent and challenge Sun’s position).

Wow! what a smart approach! I am wondering what the Sun’s reaction is going to be!!!! As a Java developer, I don’t want to develop the applications that only run on Android even if they give 10 million dollar prize. If I did that, it would be encouraging such evil practices of creating non-standard Java.

Why Google is not following the open standards(Java is open source)? Why they are tweaking the standards? What happened to Google’s “Don’t be evil” policy?

What is your take on this?