Art for Art’s Sake

Earlier we said that the DVM interprets the bytecode, but we weren’t being 100 percent accurate. The DVM uses a Just in Time (JIT) compiler rather than a simple interpreter, which has the benefit of many years of the JVM compiler theory and thus gives much better performance than a basic interpreter. JIT compilers are a lot faster than straightforward interpreters. JIT doesn’t have any effect either way on security because the classes.dex is not modified by the compiler.

In KitKat, Google introduced a new VM called the Android Runtime (ART). This new type of VM, called an Ahead-Of-Time (AOT) compiler, optimizes the classes.dex file when it is installed on the phone or device. Currently you can use either the DVM or ART on your ...

Get Bulletproof Android™: Practical Advice for Building Secure Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.