|
Cyril Sermon (@admin) |
Existing mobile development platforms have created an aura of exclusivity around mobile development. Whether by design or as a side-effect of the cost or complexity involved in developing native applica-tions, most mobile phones will remain nearly identical to what they were when first unwrapped.
In contrast, Android allows, even encourages, radical change. As consumer devices, Android hand-sets ship with a core set of standard applications that consumers demand on a new phone, but the real power lies in the ability for users to completely change how their device looks, feels, and functions.
Android gives developers a great opportunity. All Android applications are a native part of the phone, not just software that’s run in a sandbox on top of it. Rather than writing small-screen versions of soft-ware that can be run on low-power devices, you can now write mobile applications that change the way people use their phones.
While Android will still have to compete with existing and future mobile development platforms as an open source developer framework, the strength of use of the development environment is strongly in its favor. Certainly its free and open approach to mobile application development, with total access to the phone’s resources, is a giant step in the right direction.
With the PR job done, it’s time to look at how you can start developing applications for Android. Android applications are written using Java as a programming language but are executed using a custom virtual machine called Dalvik rather than a traditional Java VM.
Later in this chapter, you’ll be introduced to the framework, starting with a technical explanation of the Android software stack, a look at what’s included in the SDK, an introduction to the Android libraries, and a look at the Dalvik virtual machine.
Each Android application runs in a separate process within its own Dalvik instance, relinquishing all responsibility for memory and process management to the Android run time, which stops and kills processes as necessary to manage resources.
Dalvik and the Android run time sit on top of a Linux kernel that handles low-level hardware interac-tion including drivers and memory management, while a set of APIs provides access to all of the under-lying services, features, and hardware.
The Android software development kit (SDK) includes everything you need to start developing, testing, and debugging Android applications. Included in the SDK download are:
❑The Android APIs The core of the SDK is the Android API libraries that provide devel-oper access to the Android stack. These are the same libraries used at Google to create native Android applications.
❑Development Tools To turn Android source code into executable Android applications, the SDK includes several development tools that let you compile and debug your applications. You will learn more about the developer tools in Chapter 2.
❑The Android Emulator The Android Emulator is a fully interactive Android device emulator featuring several alternative skins. Using the emulator, you can see how your applications will look and behave on a real Android device. All Android applications run within the Dalvik VM so that the software emulator is an excellent environment — in fact, as it is hardware-neutral, it provides a better independent test environment than any single hardware implementation.
❑Full Documentation The SDK includes extensive code-level reference information detail-ing exactly what’s included in each package and class and how to use them. In addition to the code documentation, Android’s reference documentation explains how to get started and gives detailed explanations of the fundamentals behind Android development.
❑Sample Code The Android SDK includes a selection of sample applications that demonstrate some of the possibilities available using Android, as well as simple programs that highlight how to use individual API features.
❑Online Support Despite its relative youth, Android has generated a vibrant developer com-munity. The Google Groups at http://code.google.com/android/groups are active forums of Android developers with regular input from the Android development team at Google.
For those using the popular Eclipse IDE, Android has released a special plug-in that simplifies project creation and tightly integrates Eclipse with the Android Emulator and debugging tools. The features of the ADT plug-in are covered in more detail in Chapter 2.