When the Add to Home Screen dialog box is visible, select Widgets, as shown in Figure 7-5.

188 Part II: Building and Publishing Your First Android Application your application so that it can be placed on end users’ devices. To do so, you create an Android package file, also known as an APK file. In the following sections, I guide you through the process of creating your first APK file. Revisiting the manifest file Before you jump in and create the distributable APK file, you should take great care to make sure that your application is available to as many users as possible. This is done by getting very familiar with the uses-sdk element in the AndroidManifest.xml file. Your AndroidManifest.xml file currently has a uses-sdk entry that was created in Chapter 4: uses-sdk android:minSdkVersion=”4” The minSdkVersion property identifies which versions of the Android plat- form can install this application. In this instance, level 4 has been selected. The Silent Mode Toggle application was developed by setting the target soft- ware development kit SDK to version 8. Wait, I know, I’m using version 4 as the minimum SDK but I’m telling Eclipse and Android that I’m targeting the version 8 SDK. How can all this madness work? The Android platform, for the most part, is backward compatible. Most all the features that are in version 3 are also in version 4. Yes, small changes and sometimes new large components are released in each new version, but for the most part, everything else in the platform remains backward compatible. Therefore, stating that this application needs a minimum of SDK version 4 signifies that any Android operating system that is of version 4 or greater can run the application. Using the minSdkVersion information, the Android Market can determine which applications to show each user of each device. If you were to release the application right now with minSdkVersion set to the value of 4, and you opened the Android Market on an Android device running version 3 Android 1.5 or lower, you would not be able to find your application. Why? The Android Market filters it out for you. You, the developer, told the Android Market, “Hey This app can only run on devices that are of API Level 4 or greater” If you were to open the Android Market on a device running API Level 4 or above, you would be able to find and install your application. If you do not provide a minSdkVersion value in the uses-sdk element of the application’s manifest, the Android Market defaults the minSdkVersion to 0, which means that this application is compatible with all versions of Android. If your application happens to use a component not available in older versions of the platform such as the Bluetooth technology in Android 2.0 and a user installs your application, he or she receives a run-time error informing the user that the application could not continue because an exception occurred.