You are on page 1of 8

A brief history of Android

The Android platform is the product of the Open Handset Alliance, a group of organizations
collaborating 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.

Android Architecture
The following diagram shows the major components of the Android operating system. Each section is
described in more detail below.
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.0 specification (hardware acceleration optional)
• SQLite for structured data storage
• Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC,
AMR, JPG, PNG, GIF)
• GSM Telephony (hardware dependent)
• Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
• Camera, GPS, compass, and accelerometer (hardware dependent)
• Rich development environment including a device emulator, tools for debugging, memory and
performance profiling, and a plugin for the Eclipse IDE

Applications
Android will ship with a set of core applications including an email client, SMS program, calendar, maps,
browser, contacts, and others. All applications are written using the Java programming language.

Application Framework
By providing an open development platform, Android offers developers the ability to build extremely rich
and innovative applications. Developers are free to take advantage of the device hardware, access
location information, run background services, set alarms, add notifications to the status bar, and much,
much more.

Developers have full access to the same framework APIs used by the core applications. 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). This same mechanism allows components to be replaced by the user.

Underlying all applications is a set of services and systems, including:

• A rich and extensible set of Views that can be used to build an application, including lists, grids,
text boxes, buttons, and even an embeddable web browser
• Content Providers that enable applications to access data from other applications (such as
Contacts), or to share their own data
• A Resource Manager, providing access to non-code resources such as localized strings,
graphics, 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, see the Notepad Tutorial.

Libraries
Android includes a set of C/C++ libraries used by various components of the Android system. These
capabilities are exposed to developers through the Android application framework. Some of the core
libraries are listed below:

• System C library - a BSD-derived implementation of the standard C system library (libc), tuned
for embedded Linux-based devices
• Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback and
recording of many popular audio and video formats, as well as static image files, including
MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
• Surface Manager - manages access to the display subsystem and seamlessly composites 2D
and 3D graphic layers from multiple applications
• LibWebCore - a modern web browser engine which powers both the Android browser and an
embeddable web view
• SGL - the underlying 2D graphics engine
• 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either
hardware 3D acceleration (where available) or the included, highly optimized 3D software
rasterizer
• FreeType - bitmap and vector font rendering
• SQLite - 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.

Every Android application runs in its own process, with its own instance of the Dalvik virtual machine.
Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in
the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-
based, and runs classes compiled by a Java language compiler that have been transformed into the .dex
format by the included "dx" tool.

The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level
memory management.

The Android platform

With Android's breadth of capabilities, it would be easy to confuse it with a desktop operating
system. Android is a layered environment built upon a foundation of the Linux kernel, and it
includes rich functions. The UI subsystem includes:

• Windows
• Views
• Widgets for displaying common elements such as edit boxes, lists, and drop-down lists

Android includes an embeddable browser built upon WebKit, the same open source browser
engine powering the iPhone's Mobile Safari browser.

Android boasts a healthy array of connectivity options, including WiFi, Bluetooth, and wireless
data over a cellular connection (for example, GPRS, EDGE, and 3G). A popular technique in
Android applications is to link to Google Maps to display an address directly within an
application. Support for location-based services (such as GPS) and accelerometers is also
available in the Android software stack, though not all Android devices are equipped with the
required hardware. There is also camera support.

Historically, two areas where mobile applications have struggled to keep pace with their desktop
counterparts are graphics/media, and data storage methods. Android addresses the graphics
challenge with built-in support for 2-D and 3-D graphics, including the OpenGL library. The
data-storage burden is eased because the Android platform includes the popular open source
SQLite database. Figure 1 shows a simplified view of the Android software layers.

Figure 1. Android software layers

Back to top

Application architecture
As mentioned, Android runs atop a Linux kernel. Android applications are written in the Java
programming language, and they run within a virtual machine (VM). It's important to note that
the VM is not a JVM as you might expect, but is the Dalvik Virtual Machine, an open source
technology. Each Android application runs within an instance of the Dalvik VM, which in turn
resides within a Linux-kernel managed process, as shown below.

Figure 2. 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. When a user selects
an application from the home screen or application launcher, an activity is started.
Services
A service should be used for any application that needs to persist for a long time, such as
a network monitor or update-checking application.
Content providers
You can think of content providers as a database server. A content provider's job is to
manage access to persisted data, such as a SQLite database. If your application is very
simple, you might not necessarily create a content provider. If you're building a larger
application, or one that makes data available to multiple activities or applications, a
content provider is the means of accessing your data.
Broadcast receivers
An Android application may be launched to process a element of data or respond to an
event, such as the receipt of a text message.

An Android application, along with a file called AndroidManifest.xml, is deployed to a device.


AndroidManifest.xml contains the necessary configuration information to properly install it to
the device. It includes the required class names and types of events the application is able to
process, and the required permissions the application needs to run. For example, if an application
requires access to the network — to download a file, for example — this permission must be
explicitly stated in the manifest file. Many applications may have this specific permission
enabled. Such declarative security helps reduce the likelihood that a rogue application can cause
damage on your device.

The next section discusses the development environment required to build an Android
application.

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). Android development can take place on Microsoft®
Windows®, Mac OS X, or Linux.

This article assumes you are using the Eclipse IDE and the Android Developer Tools plug-in for
Eclipse. Android applications are written in the Java language, but compiled and executed in the
Dalvik VM (a non-Java virtual machine). Coding in the Java language within Eclipse is very
intuitive; Eclipse provides a rich Java environment, including context-sensitive help and code
suggestion hints. Once your Java code is compiled cleanly, the Android Developer Tools make
sure the application is packaged properly, including the AndroidManifest.xml file.

It's possible to develop Android applications without Eclipse and the Android Developer Tools
plug-in, but you would need to know your way around the Android SDK.

The Android SDK is distributed as a ZIP file that unpacks to a directory on your hard drive.
Since there have been several SDK updates, it is recommended that you keep your development
environment well organized so you can easily switch between SDK installations. The SDK
includes:

android.jar
Java archive file containing all of the Android SDK classes necessary to build your
application.
documention.html and docs directory
The SDK documentation is provided locally and on the Web. It's largely in the form of
JavaDocs, making it easy to navigate the many packages in the SDK. The documentation
also includes a high-level Development Guide and links to the broader Android
community.
Samples directory
The samples subdirectory contains full source code for a variety of applications,
including ApiDemo, which exercises many APIs. The sample application is a great place
to explore when starting Android application development.
Tools directory
Contains all of the command-line tools to build Android applications. The most
commonly employed and useful tool is the adb utility (Android Debug Bridge).
usb_driver
Directory containing the necessary drivers to connect the development environment to an
Android-enabled device, such as the G1 or the Android Dev 1 unlocked development
phone. These files are only required for developers using the Windows platform.

Android applications may be run on a real device or on the Android Emulator, which ships with
the Android SDK. Figure 3 shows the Android Emulator's home screen.

You might also like