Solution and Answer Guide: Android Boot Camp for Developers Using Java® A Guide to Creating Your First Android Apps 4th Edition Corinne Hoisington
Solution and Answer Guide Android Boot Camp for Developers Using Java® A Guide to Creating Your First Android Apps 4th Edition Corinne Hoisington Chapter 1-12 Chapter 1: Voila! Meet the Android
TABLE OF CONTENTS Developer FAQs .................................................................................................................................1 Beyond the Book ...............................................................................................................................2 Case Programming Projects ................................................................................................................3
DEVELOPER FAQS 1.
What is the dessert name that starts with an “N” to identify an Android version? (1.4) Answer: Nougat
2.
What is the one-time cost for a developer’s account at Google Play? (1.5) Answer: $25
3.
When you post an Android app at Google Play, what percentage of the app price does the developer keep? (1.5) Answer: 85%
4.
_________________ is the web address of Google Play. (1.5) Answer: play.google.com
5.
What share of the world’s smartphone market is represented by Android? (1.1) Answer: 72%
6.
Java is the most popular coding language used to create Android apps. What other language is also used? (1.4) Answer: Kotlin
© 2023 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
1
Solution and Answer Guide: Chapter 1: Voila! Meet the Android
7.
In which subfolder is the activity_main.xml file stored? (1.7) Answer: layout
8.
Name three widgets in the Palette mentioned in this chapter. (1.8, 1.9) Answer: TextView, Button, Checkbox
9.
What is the name of the widget that was used in the Hello Android World app? (1.8, 1.9) Answer: TextView
10. Which two key combinations can you press to run an Android app in Android Studio? (1.9) Answer: In Windows, Shift+F10; on a Mac, Command+Shift+F11 11. Which Android version is Kit Kat? (1.4) Answer: 4.4 12. Using the alphabetical theme for Android version names, name three possible future names for the next versions of Android device operating systems. (1.4) Answer: Using the theme of desserts, any three dessert names after Tiramisu alphabetically 13. Which two attributes were changed in the Hello Android World app? (1.9) Answer: text and id 14. What does SDK stand for? (1.4) Answer: Software Development Kit 15. What does XML stand for? (1.4) Answer: Extensible Markup Language
BEYOND THE BOOK Search the web for answers to the following questions to further your Android knowledge.
© 2023 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
2
Solution and Answer Guide: Hoisington, Android Boot Camp for Developers Using JAVA: A Guide to Creating Your First Android Apps 4e, 9780357881231, Chapter 2: Simplify! The Android User Interface
1.
Research a particular model of a popular Android smartphone or tablet device and write a paragraph on its features, specifications, price, and manufacturer. Answer: Answers will vary.
2.
Name five Android mobile device features not mentioned in Chapter 1. Answer: Answers will vary.
3.
Research and provide three advantages that a Windows 11 user has with Android smartphones and apps. Write and explain the advantages in full sentences. Answer: Answers will vary.
4.
Go to the Google Play website and take a screenshot of each of the following app categories: education, gaming, mapping, travel, and personal hobby. Place the screenshots in a word-processing document and label each one to identify them. Answer: Answers will vary.
5.
Create a timeline of the Android product from the past to present day. Answer: Answers will vary.
CASE PROGRAMMING PROJECTS Working code is provided in the chapter’s Solutions folders for each case programming project.
Solution and Answer Guide Hoisington, Android Boot Camp for Developers Using JAVA: A Guide to Creating Your First Android Apps 4e, 9780357881231, Chapter 2: Simplify! The Android User Interface
TABLE OF CONTENTS Developer FAQs .................................................................................................................................1 Beyond the Book ...............................................................................................................................2 Case Programming Projects ................................................................................................................3
© 2023 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
3
Solution and Answer Guide: Hoisington, Android Boot Camp for Developers Using JAVA: A Guide to Creating Your First Android Apps 4e, 9780357881231, Chapter 2: Simplify! The Android User Interface
DEVELOPER FAQS 1.
What are the three components used in this chapter? (2.1) Answer: TextView, ImageView, and Button
2.
If you were creating an app in many different languages, would you have to write the entire program from scratch for each language? What part of the program would stay the same? What part of the program would be different? (2.2) Answer: No. You can keep all the same Java classes; just use different strings.xml files for each language display.
3.
In which subfolder in the Android project view are the XML files stored? (2.1) Answer: layout
4.
In the chapter’s example project, which kind of layout was used to lay out the components on the emulator? (2.3) Answer: ConstraintLayout
5.
What is the term that describes the screen size, configuration, or physical layout of a device? (2.1) Answer: form factor
6.
What are the building blocks of an Android layout that attach or align a component to the screen either by attaching it vertically and horizontally to the edges of the screen or by aligning it with another component? (2.3) Answer: constraints
7.
Which measurement is most preferred for text size? Why? (2.3) Answer: sp. If a user has selected sp and set up an Android phone to display a large font size for more clarity and easier visibility, the font in the app will be scaled to meet the user’s size preference.
8.
What does px stand for? (2.3) Answer: pixel
9.
What does sp stand for? (2.3)
© 2023 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
4
Solution and Answer Guide: Hoisington, Android Boot Camp for Developers Using JAVA: A Guide to Creating Your First Android Apps 4e, 9780357881231, Chapter 2: Simplify! The Android User Interface
Answer: scaled-independent pixels 10. What is a stub? (2.8) Answer: A piece of code that serves as a placeholder to declare itself; it has just enough code to link to the rest of the program 11. Which picture file types are accepted for an ImageView component? (2.3) Answer: .jpg, .png, and.gif 12. Which picture file type is preferred? (2.3) Answer: .png 13. In which attribute can you describe an ImageView component for screen readers to improve accessibility? (2.2) Answer:
contentDescription property
14. Which four attributes were changed in the chapter project for the Button component? (2.3) Answer: id, text, backgroundTint, and textSize 15. What is the attribute that defines the name of an ImageView component? (2.2) Answer: id 16. Write one line of code that would launch a second class named Drone from the present MainActivity class. (2.9) Answer: startActivity(new Intent(MainActivity.this, Drone.class)); 17. Write one line of code that declares a Button component with a variable named button, which references a button in the XML layout with the id attribute of btBlackWidow. (2.7) Answer: Button button = (Button) findViewById(R.id.btnBlackWidow); 18. Write one line of code that opens the XML layout named reality. (2.9) Answer: setContentView(R.layout.reality); 19. Which two keys are pressed to auto-complete a line of Java code on a PC? (2.8) Answer: Alt+Enter 20. What character is placed at the end of most lines of Java code? (2.10)
© 2023 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
5