This action might not be possible to undo. Are you sure you want to continue?
to build a better mobile phone. The group, led by Google, includes mobile operators, device handset manufacturers, component manufacturers, software solution and platform providers, and marketing companies. From a software development standpoint, Android sits smack in the middle of the open source world. The first Android-capable handset on the market was the G1 device manufactured by HTC and provisioned on T-Mobile. The device became available after almost a year of speculation, where the only software development tools available were some incrementally improving SDK releases. As the G1 release date neared, the Android team released SDK V1.0 and applications began surfacing for the new platform. To spur innovation, Google sponsored two rounds of "Android Developer Challenges," where millions of dollars were given to top contest submissions. A few months after the G1, the Android Market was released, allowing users to browse and download applications directly to their phones. Over about 18 months, a new mobile platform entered the public arena.
What is Android?
Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
The following diagram shows the major components of the Android operating system. Each section is described in more detail below.
AMR. PNG. and WiFi (hardware dependent) Camera.Features • • • • • • • • • Application framework enabling reuse and replacement of components Dalvik virtual machine optimized for mobile devices Integrated browser based on the open source WebKit engine Optimized graphics powered by a custom 2D graphics library. 3D graphics based on the OpenGL ES 1. 3G. JPG. MP3. and still image formats (MPEG4. GIF) GSM Telephony (hardware dependent) Bluetooth. AAC. EDGE. compass.264. H. and accelerometer (hardware dependent) . GPS.0 specification (hardware acceleration optional) SQLite for structured data storage Media support for common audio. video.
including lists. maps. and a plugin for the Eclipse IDE Applications Android will ship with a set of core applications including an email client. and layout files A Notification Manager that enables all applications to display custom alerts in the status bar An Activity Manager that manages the lifecycle of applications and provides a common navigation backstack For more details and a walkthrough of an application. Application Framework By providing an open development platform. much more. see the Notepad Tutorial. Android offers developers the ability to build extremely rich and innovative applications. and others. calendar. Underlying all applications is a set of services and systems. Developers are free to take advantage of the device hardware. Developers have full access to the same framework APIs used by the core applications. run background services. graphics. access location information. tools for debugging. The application architecture is designed to simplify the reuse of components. any application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework). buttons. including: • • • • • A rich and extensible set of Views that can be used to build an application. providing access to non-code resources such as localized strings. All applications are written using the Java programming language. add notifications to the status bar. browser. SMS program. grids. memory and performance profiling. This same mechanism allows components to be replaced by the user. text boxes. contacts. and even an embeddable web browser Content Providers that enable applications to access data from other applications (such as Contacts).• Rich development environment including a device emulator. and much. set alarms. Libraries . or to share their own data A Resource Manager.
the libraries use either hardware 3D acceleration (where available) or the included. The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.an implementation based on OpenGL ES 1.a modern web browser engine which powers both the Android browser and an embeddable web view SGL . Dalvik has been written so that a device can run multiple VMs efficiently. The Android platform With Android's breadth of capabilities. These capabilities are exposed to developers through the Android application framework.0 APIs. and PNG • • • • Surface Manager . The Dalvik VM executes files in the Dalvik Executable (. Some of the core libraries are listed below: • • System C library . Every Android application runs in its own process. the libraries support playback and recording of many popular audio and video formats. JPG.dex) format which is optimized for minimal memory footprint.a BSD-derived implementation of the standard C system library (libc). and runs classes compiled by a Java language compiler that have been transformed into the . as well as static image files. The UI subsystem includes: • Windows . highly optimized 3D software rasterizer • • FreeType . Android is a layered environment built upon a foundation of the Linux kernel. AAC.a powerful and lightweight relational database engine available to all applications Android Runtime Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language. tuned for embedded Linux-based devices Media Libraries . AMR.the underlying 2D graphics engine 3D libraries . H. with its own instance of the Dalvik virtual machine. The VM is registerbased. it would be easy to confuse it with a desktop operating system.bitmap and vector font rendering SQLite .based on PacketVideo's OpenCORE. including MPEG4.Android includes a set of C/C++ libraries used by various components of the Android system.manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications LibWebCore .264.dex format by the included "dx" tool. MP3. and it includes rich functions.
EDGE. and data storage methods. and 3G). lists. though not all Android devices are equipped with the required hardware. Figure 1 shows a simplified view of the Android software layers. including the OpenGL library. There is also camera support.• • Views Widgets for displaying common elements such as edit boxes. the same open source browser engine powering the iPhone's Mobile Safari browser. Bluetooth. and drop-down lists Android includes an embeddable browser built upon WebKit. Android software layers Back to top Application architecture . Historically. Support for location-based services (such as GPS) and accelerometers is also available in the Android software stack. Android addresses the graphics challenge with built-in support for 2-D and 3-D graphics. The data-storage burden is eased because the Android platform includes the popular open source SQLite database. Figure 1. including WiFi. Android boasts a healthy array of connectivity options. GPRS. two areas where mobile applications have struggled to keep pace with their desktop counterparts are graphics/media. and wireless data over a cellular connection (for example. A popular technique in Android applications is to link to Google Maps to display an address directly within an application.
or one that makes data available to multiple activities or applications. If your application is very simple.xml. Android runs atop a Linux kernel. such as the receipt of a text message. For example. Each Android application runs within an instance of the Dalvik VM. but is the Dalvik Virtual Machine. Dalvik VM An Android application consists of one or more of the following classifications: Activities An application that has a visible UI is implemented with an activity. as shown below. such as a SQLite database. Android applications are written in the Java programming language. and they run within a virtual machine (VM). a content provider is the means of accessing your data. and the required permissions the application needs to run. if an application . When a user selects an application from the home screen or application launcher. Content providers You can think of content providers as a database server. It includes the required class names and types of events the application is able to process. It's important to note that the VM is not a JVM as you might expect. such as a network monitor or update-checking application. An Android application. along with a file called AndroidManifest. an activity is started. which in turn resides within a Linux-kernel managed process.As mentioned.xml contains the necessary configuration information to properly install it to the device. AndroidManifest. A content provider's job is to manage access to persisted data. is deployed to a device. Services A service should be used for any application that needs to persist for a long time. Broadcast receivers An Android application may be launched to process a element of data or respond to an event. Figure 2. If you're building a larger application. an open source technology. you might not necessarily create a content provider.
The SDK includes: android. Back to top Required tools The easiest way to start developing Android applications is to download the Android SDK and the Eclipse IDE (see Resources). Since there have been several SDK updates. It's largely in the form of JavaDocs.xml file.html and docs directory The SDK documentation is provided locally and on the Web. the Android Developer Tools make sure the application is packaged properly. but you would need to know your way around the Android SDK. but compiled and executed in the Dalvik VM (a non-Java virtual machine).requires access to the network — to download a file. Android applications are written in the Java language. Coding in the Java language within Eclipse is very intuitive. It's possible to develop Android applications without Eclipse and the Android Developer Tools plug-in. for example — this permission must be explicitly stated in the manifest file. including the AndroidManifest. The next section discusses the development environment required to build an Android application. or Linux. Tools directory . which exercises many APIs. This article assumes you are using the Eclipse IDE and the Android Developer Tools plug-in for Eclipse. Eclipse provides a rich Java environment. Once your Java code is compiled cleanly. Such declarative security helps reduce the likelihood that a rogue application can cause damage on your device. The sample application is a great place to explore when starting Android application development. Samples directory The samples subdirectory contains full source code for a variety of applications. Mac OS X. Android development can take place on Microsoft® Windows®. The Android SDK is distributed as a ZIP file that unpacks to a directory on your hard drive. it is recommended that you keep your development environment well organized so you can easily switch between SDK installations. Many applications may have this specific permission enabled. making it easy to navigate the many packages in the SDK. including ApiDemo.jar Java archive file containing all of the Android SDK classes necessary to build your application. The documentation also includes a high-level Development Guide and links to the broader Android community. including context-sensitive help and code suggestion hints. documention.
which ships with the Android SDK. .Contains all of the command-line tools to build Android applications. usb_driver Directory containing the necessary drivers to connect the development environment to an Android-enabled device. Android applications may be run on a real device or on the Android Emulator. Figure 3 shows the Android Emulator's home screen. These files are only required for developers using the Windows platform. The most commonly employed and useful tool is the adb utility (Android Debug Bridge). such as the G1 or the Android Dev 1 unlocked development phone.