What is Dalvik? We hear that word getting thrown around a lot on the Internet when talking about Android and its inner workings. While there's no easy explanation we can give in just a few paragraphs, we can cover the basics and point you in the right direction if you need to feed your nerdly side. In its simplest terms, Dalvik is a virtual machine that runs applications and code written in Java. A standard Java compiler turns source code (written as text files) into Bytecode, then compiled into a .dex file that the Dalvik VM can read and use. In essence, class files are converted into .dex files (much like a jar file if one were using the standard Java VM) and then read and executed by the Dalvik Virtual Machine. Duplicate data used in class files is included only once in the .dex output, which saves space and uses less overhead. The executable files can be modified again when you install an application to make things even more optimized for mobile. Things like byte order swapping and linking data structure and function libraries inline make the files smaller and run better on our devices. The Dalvik VM was written from square one with Android in mind.
Confused yet? Don't feel bad, geeky programming talk usually has that effect. Think of it this way -- when you build a Java application for your computer, a Java Virtual Machine runs the compiled output of the source code. This is why Java runs on just about any operating system. Dalvik is a mobile-optimized version of a Java Virtual Machine, built with code from the Apache Harmony project, which is open-source and runs better than a standard Java VM would on our limited hardware, designed so that you can run more than one instance of the VM at a time -- ie multitasking. Because Dalvik is open-source, it's also been ported to other operating systems, like the one on the BlackBerry PlayBook. It's pretty damn complicated, pretty damn cool, and Oracle (the company that bought Java from Sun) hates it.
Android uses Dalvik because while the license for the standard Java Virtual Machine is GPL2 (free and open-source), when placed in a mobile device and using the Java Micro Edition, it is not. The big dispute between Google and Oracle is all based around Dalvik. Google claims it was written in a "clean-room" environment without using any of Oracle's code, and Oracle disagrees. We claim to have no idea, we're just glad it works as well as it does.
For more on Dalvik, see the Google I/O website.
Previously on Android A to Z: What is CES?; Find more in The Android Dictionary
More from the Android Dictionary
Sony just invested a lot of money in Epic Games — here's why that's smart
Sony's move to invest in Epic Games ahead of the PS5 launch makes a lot of sense. Whether you love or hate Epic, the company has technology and expertise that Sony will benefit from.
Here are 5 features Google is working on for Android 12 and beyond
The Android development team recently held an AMA on Reddit answering technical questions about the upcoming software. While we didn't learn anything about the upcoming software, we do have an idea of some things heading to Android 12 (and beyond).
Android updates are coming faster than ever, but still not fast enough
You'll never see the day where all Android phones get updated to new operating systems on the day they're announced. But we are seeing remarkable improvements.
The Xperia 1 is still our favorite phone for shooting video
If video recording is your thing, then look no further than the Sony Xperia 1 — it offers a large screen, three great cameras, and extremely robust manual video controls.