Introduction to Android Application Development, Fourth Edition (2014)

Part VI. Appendixes

E. Answers to Quiz Questions

Chapter 1: Introducing Android

1. The Brick

2. Snake

3. Android, Inc.

4. G1 was the name. HTC was the manufacturer. T-Mobile was the carrier.

Chapter 2: Setting Up Your Android Development Environment

1. Version 6

2. Unknown sources

3. USB debugging

4. android.jar

5. junit.*

6. Google AdMob Ads SDK

Chapter 3: Writing Your First Android Application

1. Snapshot greatly improves emulator startup performance.

2. The e means ERROR, w means WARN, i means INFO, v means VERBOSE, and d means DEBUG.

3. Step Into is F5. Step Over is F6. Step Return is F7. Resume is F8.

4. Ctrl+Shift+O on Windows and Command+Shift+O on Mac

5. Double-clicking on the far-left column of the intended line of code

6. Alt+Shift+S

Chapter 4: Android Application Basics

1. Context

2. getApplicationContext()

3. getResources()

4. getSharedPreferences()

5. getAssets()

6. The “back stack”

7. onSaveInstanceState()

8. sendBroadcast()

Chapter 5: Defining Your Application Using the Android Manifest File

1. Manifest, Application, Permissions, Instrumentation, AndroidManifest.xml

2. android:versionName, android:versionCode

3. <uses-sdk>

4. <uses-configuration>

5. <uses-feature>

6. <supports-screens>

7. <uses-library>

8. <permission>

Chapter 6: Managing Application Resources

1. False

2. Property animations, tweened animations, color state lists, drawables, layouts, menus, arbitrary raw files, simple values, arbitrary XML

3. getString()

4. getStringArray()

5. PNG, Nine-Patch Stretchable Images, JPEG, GIF, WEBP

6. @resource_type/variable_name

Chapter 7: Exploring User Interface Building Blocks

1. findViewById()

2. getText()

3. EditText

4. AutoCompleteTextView, MultiAutoCompleteTextView

5. False

6. False

Chapter 8: Designing with Layouts

1. False

2. True

3. setContentView()

4. False

5. android:layout_attribute_name=”value”

6. False

7. False

8. ScrollView

Chapter 9: Partitioning the User Interface with Fragments

1. FragmentManager

2. getFragmentManager()

3. The fully qualified Fragment class name

4. False

5. DialogFragment, ListFragment, PreferenceFragment, WebViewFragment

6. ListView

7. With the Android Support Package

Chapter 10: Displaying Dialogs

1. Dialog, AlertDialog, CharacterPickerDialog, DatePickerDialog, ProgressDialog, TimePickerDialog, Presentation

2. False

3. dismiss()

4. AlertDialog

5. True

6. getSupportFragmentManager()

Chapter 11: Using Android Preferences

1. Boolean, Float, Integer, Long, String, String Set

2. True

3. /data/data/<package name>/shared_prefs/<preferences filename>.xml

4. android:key, android:title, android:summary, android:defaultValue

5. addPreferencesFromResource()

Chapter 12: Working with Files and Directories

1. 0, 32768

2. False

3. /data/data/<package name>/

4. openFileOutput()

5. getExternalCacheDir()

6. False

Chapter 13: Leveraging Content Providers

1. MediaStore

2. True

3. READ_CONTACTS

4. False

5. addWord()

6. False

Chapter 14: Designing Compatible Applications

1. True

2. 99%

3. <supports-screens>

4. False

5. ldltr, ldrtl

6. False

7. onConfigurationChanged()

Chapter 15: Learning the Android Software Development Process

1. False

2. The lowest common denominator method and the customization method

3. Early, when project requirements are just determined and target devices are determined

4. False

5. Write and compile the code, run the application in the software emulator, test and debug the application in the software emulator or test device, package and deploy the application to the target devices, test and debug the application on the target devices, and incorporate changes from the team and repeat until the application is complete.

Chapter 16: Designing and Developing Bulletproof Android Applications

1. How many users install the application, how many users launch the application for the first time, how many users regularly use the application, what the most popular usage patterns and trends are, what the least popular usage patterns and features are, what devices are the most popular

2. Updating means modifying the Android manifest version information and redeploying the updated application on users’ devices. Upgrading means creating an entirely new application package with new features and deploying it as a separate application that the user needs to choose to install and that does not replace the old application.

3. The Android emulator using different AVDs, DDMS, Hierarchy Viewer in Pixel Perfect View, layoutopt, Draw Nine-Patch tool, real devices, technical specifications for specific devices

4. False

5. The Android IDE, Eclipse with the ADT plugin, Android Studio, the Android emulator, physical devices, DDMS, adb, sqlite3, the Hierarchy Viewer

6. False

Chapter 17: Planning the Android Application Experience

1. The activities must reside on the same hierarchy level within the application, and a simple call to startActivity() is all that is required.

2. Define the parentActivityName and use the correct Activity.

3. onBackPressed()

4. setDisplayHomeAsUpEnabled(true);

5. android:uiOptions=”splitActionBarWhenNarrow”

6. getActionBar().hide();

Chapter 18: Testing Android Applications

1. True

2. Test application integration points, test application upgrades, test device upgrades, test product internationalization, test for conformance, installation testing, backup testing, performance testing, test in-app billing, test for the unexpected, and test to increase your chances of being a “killer app”

3. JUnit

4. .test

5. test

6. False

7. TouchUtils

Chapter 19: Publishing Your Android Application

1. ProGuard

2. False

3. Google Analytics App Tracking SDK

4. versionName is used to display application version information to users, and versionCode is an integer that Google Play uses internally to handle application upgrades.

5. True

6. False

7. A Google Wallet Merchant account

Appendix A: Mastering the Android Development Tools

1. True

2. /platform-tools

3. False

4. Graphical Layout mode, XML editing mode

5. Hierarchy Viewer

Appendix B: Quick-Start Guide: The Android Emulator

1. F8

2. Ctrl+F11/Ctrl+F12

3. F6

4. onPause() and onStop()

5. hw.gpu.enabled

6. telnet localhost <port>

7. geo fix <longitude> <latitude> [<altitude>]

Appendix C: Quick-Start Guide: Android DDMS

1. /tools

2. True

3. Attach and debug applications in the Android IDE, monitor threads, monitor the heap, stop processes, force garbage collection

4. TrafficStats

5. False

Appendix D: Android IDE and Eclipse Tips and Tricks

1. True

2. Ctrl+M on Windows, Command+M on Mac

3. With two source file windows open, grab the tab for a source file and drag it either to the edge of the editor area or to the bottom.

4. False

5. Ctrl+Shift+F on Windows, Command+Shift+F on Mac

6. Alt+Shift+L

7. Ctrl+1 on Windows, Command+1 on Mac