Online Book Reader

Home Category

Developing Android Applications with Adobe AIR [10]

By Root 2571 0
-r first.apk

Conclusion

Congratulations, you have just created and tested your first application. You can expand on it and make it more dynamic by requesting the user to enter a phone number. To do so, provide an input text field, or create a custom-designed numeric UI.

Chapter 3. Android

Anyone can build a fast CPU. The trick is to build a fast system.

—Seymour Cray

Android is a mobile operating system initially created by Android Inc., and based on the open source Linux kernel. Linux, created in 1991 by Linus Torvalds, is still one of the most significant examples of open source software ever available.

Google acquired Android Inc., in 2005, and along with other members of the Open Handset Alliance, developed and released Android in 2007. The Android Open Source Project (AOSP) now maintains and expands the Android system. Figure 3-1 shows the Android logo.

Android includes an operating system, middleware, and some key applications. It is designed to be optimal for use in the mobile environment, and is flexible and upgradeable. The most recent versions at the time of this writing are Android 2.3 (called Gingerbread, released in fall 2010), and Android 3.0 (called Honeycomb, released at the beginning of 2011).

Android penetration on mobile devices is rapidly expanding. More information on Android is available at http://www.tbray.org/ongoing/When/201x/2010/11/14/What-Android-Is.

Figure 3-1. The Android logo

Early feedback on developing applications for Android was not very positive. The system was buggy, there was no bug tracking in place, and very little documentation was available. Nowadays, developing for this system has greatly improved. A public issue tracker is available and an active community has grown (see http://source.android.com/ and http://developer.android.com/index.html). The Android framework enables the reuse and replacement of components. As an AIR developer, you can read these forums to stay informed on system development and native functionality. An additional forum is also maintained on the Adobe site for specific questions regarding AIR for Android: http://forums.adobe.com/community/air/development/android.

Android Software Development Kit


Android provides great mobile tooling for Java developers to use along with Eclipse or similar editors to write native applications. We will go over some of the tools and how you may want to use them as an AIR developer. But first, let’s install the SDK.

Installing the Android SDK


Before we begin, make sure you are running in administrator mode so that you have all the needed permissions and access.

The Android SDK requires Java 1.6 or later, which you can obtain at http://www.java.com/en/download or http://www.oracle.com/technetwork/java/javase/downloads/index.html. You can download the SDK for Windows, Mac OS (Intel), or Linux at http://developer.android.com/sdk/index.html. The Android SDK only contains the minimum tools to start with. Use the SDK Manager to install or update components.

The SDK directory has different names depending on its version and your platform. It may be named something like android-sdk_r08-mac.zip or android-sdk_r08-windows.zip. For the sake of simplicity, rename it to androidSDK. We will use this name to refer to the SDK folder for the rest of the chapter.

Check that you have an Internet connection and an open terminal (or a command prompt on Windows), and enter the following command. If you are not familiar with using the command line, refer to Using the Command-Line Tool, which covers this topic:

androidSDK/platform-tools/android update sdk

You need Android SDK Tools, revision 6 or later, which might already be installed by default. Click the Settings button and check the “Force https” box; then select the boxes to download SDK Platform Android 2.2, API 8, revision 2. You will need these files in order to use the emulator.

WARNING

Unfortunately, installation steps change as the SDK evolves. For instance, the tools directory in revision 6 was renamed platform-tools in revision 8. In addition, version

Return Main Page Previous Page Next Page

®Online Book Reader