I ran into Bob Lee last week and found out he’s been working on Android at Google and doing a lot of C (gasp, horror). Now that it’s out I took a look at some of the videos and docs and stuff and it looks kind of cool. If I ever actually used my cell phone, I’d love to hack on it with Java!
Actually, since I work at Terracotta, a company that makes a Java clustering technology, my first thought was “Cool – now I can write a Java app with Terracotta and share clustered state on a bunch of phones!” It’s like the Android Army!
But sadly, that ain’t gonna happen because Android is not really Java, it just looks like it. Apparently the API and IDE use Java syntax and work under Eclipse and use Apache’s Harmony class library, but ultimately it’s all getting translated to run on this Dalvik VM thingie. Dalvik is not Java and apparently works by translating .class files at some point along the way. You can find some interesting thoughts on this strategy by these fine people:
Very interesting approach to leveraging the open and popular parts of Java but sidestepping the legal and IP (and monetary) issues to using the J2ME runtime.
In any case, Terracotta relies on hooking into the JVM at startup by using some modified classes in the bootclasspath. (Note – not modifying the JVM, just a few of the core classes like ClassLoader so we can instrument code at load time.) And that’s surely a little too deep to possibly work over Dalvik.
Of course, I have no practical reason to want to do this, just thought it would be cool.