Appendix C. Answers to Exercises

This appendix includes the answers to the end of chapter exercises.


  1. An AVD is an Android Virtual Device. It represents an Android Emulator, which emulates a particular configuration of an actual Android device.

  2. The android:versionCode attribute 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:versionName attribute is used mainly for displaying to the user. It is a string, such as "1.0.1".

  3. The strings.xml file 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.


  1. The Android OS will display a dialog from which users can choose which activity they want to use.

  2. Intent i = new
  3. In an intent filter, you can specify the following: action, data, type, and category.

  4. The Toast class is used to display alerts to the user and disappears after a few seconds. The NotificationManager class is used to display notifications on the device's status bar. The alert displayed by the NotificationManager class is persistent and can only be dismissed by the user when selected.


  1. The dp unit is density independent and 160dp is equivalent to one inch. The px unit ...

Get Beginning Android™ Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.