Introducing the Android Computing Platform

Personal computing continues to become more "personal" in that computers are becoming increasingly accessible anytime, anywhere. At the forefront of this advancement are handheld devices that are transforming into computing platforms. Mobile phones are no longer just for talking—they have been capable of carrying data and video for some time. More significantly, the mobile device is now becoming so capable of general-purpose computing that it's destined to become the next PC. It is also anticipated that a number of manufacturers such as ASUS, HP, and Dell will be producing netbooks based on the Android OS. So the battle lines of operating systems, computing platforms, programming languages, and development frameworks are being shifted and reapplied to mobile devices.

We are also expecting a surge in mobile programming in the IT industry as more and more IT applications start to offer mobile counterparts. To help you profit from this trend, we'll show you how to use Java to write programs for devices that run on Google's Android Platform (http://code.google.com/android/), an open source platform for mobile development. We are excited about Android because it is an advanced platform that introduces a number of new paradigms in framework design. In this chapter, we'll provide an overview of Android and its SDK, show you how to take advantage of Android source code, and highlight the benefits of programming for the Android Platform.

The fact that hitherto dedicated devices such as mobile phones can now count themselves among other venerable general-computing platforms is great news for programmers (see Figure 1-1). This new trend makes mobile devices accessible through general-purpose computing languages and therefore increases the range and market share for mobile applications.

The Android Platform fully embraces this idea of general-purpose computing for handheld devices. It is indeed a comprehensive platform that features a Linux-based operating system stack for managing devices, memory, and processes. Android's libraries cover telephony, video, graphics, UI programming, and every other aspect of the physical device.

The Android Platform, although built for mobile devices, exhibits the characteristics of a full-featured desktop framework. Google makes this framework available to Java programmers through a software development kit called the Android SDK. When you are working with the Android SDK, you rarely feel that you are writing to a mobile device because you have access to most of the class libraries that you use on a desktop or a server—including a relational database.

The General Purpose Computing Club

--SI

ITF

m

B

Server Workstation

Laptop

New Kid on the Block

Figure 1-1. Handheld is the new PC.

The Android SDK supports most of Java Platform, Standard Edition (Java SE) except for the Abstract Window Toolkit (AWT) and Swing. In place of the AWT and Swing, the Android SDK has its own extensive modern UI framework. Because you're programming your applications in Java, you might expect to need a Java Virtual Machine (JVM) that is responsible for interpreting the runtime Java bytecode. A JVM typically provides necessary optimization to help Java reach performance levels comparable to compiled languages such as C and C++. Android offers its own optimized JVM to run the compiled Java class files in order to counter the handheld device limitations such as memory, processor speed, and power. This virtual machine is called the Dalvik VM, which we'll explore in the section "Delving Into the Dalvik VM."

The familiarity and simplicity of the Java programming language coupled with Android's extensive class library makes Android a compelling platform to write programs for. Figure 1-2 provides an overview of the Android software stack. (We'll provide further details in the section "Understanding the Android Software Stack.")

User Applications

Java Libraries |

Activities/Services

UI/Graphics/Views

Resources/Content Providers

Telephone/Camera

Multimedia

SQLite Database

Http/Connectivity

M

Java SE/Java Apache

Core C Libraries

Dalvik VM

Core C Libraries

Figure 1-2. High-level view of the Android software stack

0 0

Post a comment