Hacker News new | ask | show | jobs
by CyberFonic 5635 days ago
Android uses the Dalvik virtual machine, which is a clean-room implementation and different to JVM. Basically the .dex files are about 45% in size of compressed JAR files. Dalvik has been optimised for small RAM & slow CPU (compared to recent notebooks and desktops).

If you Google "Dalvik VM" you'll find lots of interesting information, too many to list here. There's a Google presentation which is very good.

So the answer to your question, is that so far, AFAIK, there is no compiler that directly generates Dalvik executables into .dex files. Currently, you need a Java .class file or a .java file and get it translated into a .dex file. But a retargetable compiler, like llc, could be customised to generate .dex files directly. An interesting project.