Tuesday 11 December 2012

Dalvik Virtual Machine


One of the key elements of  android architecture  is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run efficiently on a single device.
The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, including security, threading, and process and memory management. It’s also possible to write C/C++  applications that run closer to the underlying Linux OS. Although you can  do this, in most cases there’s no reason you should need to.
If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. (but This Blog focuses exclusively on writing applications that run within Dalvik using the SDK; NDK development is not within the scope of this blog. If your inclinations run toward NDK development, exploring the Linux kernel  and C/C++ underbelly of Android, modifying Dalvik, or otherwise tinkering with things under the hood, check out the Android Internals Google Group .)
All Android hardware and system service access is managed using Dalvik as a middle tier. By using  a VM to host application execution, developers have an abstraction layer that ensures they should never have to worry about a particular hardware implementation.
The Dalvik VM executes Dalvik executable files, a format optimized to ensure minimal memory footprint. You create .dex executables by transforming Java language compiled classes using the tools supplied within the SDK.
-   The android system uses a special virtual machine; Dalvik Virtual Machine to run Java based applications. 
- Dalvik uses an own byte code format which is different from Java byte code.
- You cannot directly run Java class files on Android, they need to get converted in the Dalvik byte code format.

No comments:

Post a Comment