Datasheet

Introducing the Development Framework
15
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++ appli-
cations that run directly on the underlying Linux OS. While 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 now 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.
This book focuses exclusively on writing applications that run within Dalvik
using the SDK. If your inclinations run toward 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 at
http://groups.google.com/group/android-internals
While use of the NDK is encouraged where needed, details of its use have not been
included within this book.
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 never have to
worry about a particular hardware implementation.
The Dalvik VM executes Dalvik executable files, a format optimized to ensure minimal memory foot-
print. You create
.dex
executables by transforming Java language compiled classes using the tools
supplied within the SDK. You’ll learn more about how to create Dalvik executables in the next chapter.
Android Application Architecture
Android’s architecture encourages the concept of component reuse, enabling you to publish and share
Activities, Services, and data with other applications, with access managed by the security restrictions
you put in place.
The same mechanism that lets you produce a replacement contact manager or phone dialer can let you
expose your application components to let other developers create new UI front ends and functionality
extensions, or otherwise build on them.
The following application services are the architectural cornerstones of all Android applications, pro-
viding the framework you’ll be using for your own software:
Activity Manager Controls the life cycle of your Activities, including management of the
Activity stack described in Chapter 3.
Views Used to construct the user interfaces for your Activities, as described in Chapter 4.
Notification Manager Provides a consistent and nonintrusive mechanism for signaling your
users, as described in Chapter 9.
Content Providers Let your applications share data, as described in Chapter 7.
Resource Manager Supports non-code resources like strings and graphics to be external-
ized, as shown in Chapter 3.