The ApiDemos application comes with the Android SDK, and can be found in the samples/ApiDemos subdirectory. It’s a treasure trove of code that shows an application developer how to use a lot of the Android API. Unfortunately, it’s left up to the student to figure out how it works. That’s where this chapter comes in. Here, we’ll show you the ropes of the ApiDemos application, and how to find the code that implements a feature that you see. Once you get the hang of it, it’s a very useful place to find out how to use Android.
For the remainder of this chapter, we’ll make a couple of assumptions when talking about files and directories:
Non-Java source files and subdirectories can be found in the samples/ApiDemos subdirectory of the directory where you install the Android SDK.
Java files are in the src/com/example/android/apis directory under the samples/ApiDemos directory.
Like every other Android application, the best place to get a sense of how the application is strung together is the application’s AndroidManifest.xml file. Let’s take a look at part of the AndroidManifest.xml file for ApiDemos, near the beginning of the file: