Summary This chapter wraps up this book with a topic that hopefully stretches your imagina-

13.5 Summary This chapter wraps up this book with a topic that hopefully stretches your imagina-

tion for the kinds of applications possible with the versatile and open platform of Android. We had the goal of writing an application outside the Android SDK and demonstrating how that kind of application may be leveraged by a standard Android Java application. To write for the Android/Linux layer, we turned to the C program- ming language.

Developing C language applications for Android/Linux is a cross-platform compi- lation exercise using the freely available CodeSourcery tool chain. This chapter dem- onstrated using that tool set in conjunction with the adb utility provided in the Android SDK. The adb utility was vital because it enabled us to push our application to the Android Emulator for testing as well as to extract the Android system libraries, which were essential for linking our application with the Android resident libraries.

C HAPTER 13 Hacking Android

Of course, we used the adb shell to interact directly with the Android Emulator to run our C application.

C language mastery on this platform is powerful because much of the C language development process involves porting existing, open source Linux code to the ARM processor. This has the potential benefit of speeding up development for future func- tionality delivery to Android by leveraging existing code bases. A logical extension to this topic would be the development of a Java Native Interface (JNI) to bring many capabilities residing in C language libraries directly into the Java environment of Android.

Our sample application exercised TCP socket communications. The TCP commu- nications capability proved to be a ready interface mechanism between the Android/ Java layer and the Android/Linux foundation of the environment in the Daytime Cli- ent and Server applications, respectively. TCP socket communications may also take place from the Android/Linux environment to external, remote systems such as email servers or directory servers, opening up literally a world of possibilities.

The Daytime Server sample application also demonstrated the use of an Android resident library to manipulate a SQLite database used to store transaction data. The impact of this step should not be minimized as it satisfies three important develop- ment challenges. The first and most basic accomplishment of this functionality is that we have demonstrated linking against, and employing, an Android resident system library. This is significant because it shows how future applications may leverage Android functionality such as Open GL or media services. Second, using a device-resi- dent database that is also accessible from the Java layer means we have an additional (and persistent) interface mechanism between the Java and Linux environments on the platform. Third, Android is a mobile platform. Anytime there is a mobile applica- tion, the topic of sharing and synching data bubbles up. We demonstrated in this chapter the ease with which an SQL-capable database was shared between the Android Emulator and a personal computer—and all without complex synchronization pro- gramming. Synchronization is, of course, a larger topic than this, but the capability of moving a single file between platforms is a welcome feature. There are only a few com- parable solutions in the marketplace for other mobile environments, and that is after literally years of market penetration by these other platforms. Android gets it right from the start.

I trust that this chapter and this book will challenge you to dig deeper and that you may enjoy Unlocking Android.

appendix A: Installing

the Android SDK

This appendix covers:

Development environment requirements

Obtaining the latest Android SDK

Configuring the Android Development Tools for Eclipse

This appendix walks through the installation of Eclipse, the Android SDK, and the ADT plug-in for Eclipse. This appendix is meant to be a reference resource to assist in setting up the environment for Android application development. The topic of using the development tools is covered in chapter 2.