Appendix C. Answers to Exercises
This appendix includes the answers to the end of chapter exercises.
An AVD is an Android Virtual Device. It represents an Android Emulator, which emulates a particular configuration of an actual Android device.
android:versionCodeattribute is used to programmatically check if an application can be upgraded. It should contain a running number (an updated application should be set to a higher number than the older version). The
android:versionNameattribute is used mainly for displaying to the user. It is a string, such as "1.0.1".
strings.xmlfile is used to store all string constants in your application. This enables you to easily localize your application by simply replacing the strings and then recompiling your application.
The Android OS will display a dialog from which users can choose which activity they want to use.
Intent i = new Intent(android.content.Intent.ACTION_VIEW, Uri.
In an intent filter, you can specify the following: action, data, type, and category.
Toastclass is used to display alerts to the user and disappears after a few seconds. The
NotificationManagerclass is used to display notifications on the device's status bar. The alert displayed by the
NotificationManagerclass is persistent and can only be dismissed by the user when selected.
dpunit is density independent and 160dp is equivalent to one inch. The