Introduction to Android
Before diving right into the ins and outs of the Eclipse plug-in and developing Android applications, let's have a look at the architecture of Android and some of the key terms that will be helpful in the tutorial and beyond, as you begin to build Android applications for yourself.
Android application development under the Eclipse environment requires knowledge of the Eclipse environment and the Android platform. An understanding of the terms below is helpful in Android application development with the Eclipse plug-in.
- Open Handset Alliance
- This is the organization led by Google Inc., consisting of numerous public and private organizations.
- The flagship product of the Open Handset Alliance. This is an open source operating environment targeted for mobile devices.
- A software tool representative of another system — This is often an environment that runs on a personal computer (IBM®, Mac, Linux®) that emulates another environment, such as a mobile-computing device.
- An open source operating system kernel at the heart of many computing platforms, including servers, desktop computers, networking appliances, and mobile-computing devices. Android runs on top of a Linux kernel.
- Dalvik Virtual Machine
- The Dalvik VM is an operating environment found in the Android stack, which interprets application code at runtime. The Dalvik VM is similar to a compliant Java VM, but the two are not compatible.
Android is an open source operating system targeted for mobile platforms. At the time of this writing, it is a software-only platform with no publicly available hardware devices.
The Android platform is best described as a stack because it is a collection of components, including:
- Linux kernel-based operating system
- Java programming environment
- Tool chain, including compiler, resource compiler, debugger, and emulator
- Dalvik VM for running applications
Now that we've briefly introduced the Android platform architecture, let's look at some important characteristics of the platform from a market perspective.
The computer technology press has lavished attention on Android since its announcement and initial SDK release. Android is important as a platform for two disparate, yet compelling, reasons, among many others.
Android is a market-mover. The mobile-application space is crowded and difficult to gain footing for a newcomer. Google has the resources and the mind-share to make a splash in any market it puts in its sights. Google's entry into the mobile space has been in the works for a few years. Android was a separate and distinct company purchased by Google to give it a jump-start on a mobile presence. Anything Google is doing gets attention, and publicity is good for introducing new platforms. Score one for Android.
The second reason Android is important is because of its application model. Android applications are not monolithic, menu-laden applications that require a great deal of clicking and tapping to operate. Sure, there are menus and buttons to be tapped, but Android has an innovative design element to its architecture known as an intent.
An intent is a construct that permits an application to issue a request, which is somewhat like a help-wanted sign. It might look like this:
"Wanted: An application to help me look up a contact" or "Wanted: An application to help me display this image" or "Wanted: An application to perform this geographic-based search."
In a similar and complementary fashion, applications can register themselves as capable and interested in performing satisfying various requests or intents. To follow the classified advertising paradigm, these might look like this:
"Available: Application ready and willing to present contact records in clear, concise manner," or "Available: Application ready and willing to perform a geographic search."
These are examples of
IntentFilters, which are discussed next.
Applications announce their availability to perform these types of operations via a
construct known as an
IntentFilter is either registered at runtime or is enumerated in the
AndroidManifest.xml file. The following snippet comes from an Android application that
responds to incoming SMS (text) messages:
Listing 1. Android application responding to incoming SMS
<receiver class=".MySMSMailBox" > <intent-filter> <action android:value="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver>
After this brief introduction to the intent and
IntentFilter, the next section introduces the four main types of Android applications.