Android Bootcamp
for Developers
Using Java, 4e
Chapter 1: Voilà! Meet the
Android
Hoisington, Android Bootcamp for Developers Using Java, 4 4th
th Edition.
Edition.©©2024
2024Cengage.
[Link]
AllRights
RightsReserved.
[Link]
Maynot
notbe
be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 1
Chapter Objectives (1 of 2)
When you complete this chapter, you will be able to:
• 01.01 Describe the market for Android applications
• 01.02 Identify the role of the Android platform in the mobile market
• 01.03 Describe the features of the Android phone
• 01.04 Identify the languages used in Android development
• 01.05 Describe the role of Google Play in the marketplace
Hoisington, Android Bootcamp for Developers Using Java, 4 4th
th Edition.
Edition.©©2024
2024Cengage.
[Link]
AllRights
RightsReserved.
[Link]
Maynot
notbe
be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 2
Chapter Objectives (2 of 2)
When you complete this chapter, you will be able to:
• 01.06 Understand the connection between Windows and Android
• 01.07 Create an Android project using Android Studio
• 01.08 Design the user interface layout within the virtual device
• 01.09 Execute an Android application on an emulator
• 01.10 Open a saved Android project in Android Studio
Hoisington, Android Bootcamp for Developers Using Java, 4 4th
th Edition.
Edition.©©2024
2024Cengage.
[Link]
AllRights
RightsReserved.
[Link]
Maynot
notbe
be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 3
1.1 Understanding the Market for Android
Applications
• Two primary mobile operating systems
− iOS for iPhone
− Google Android
• Recently, the Google Android phone has become the sales leader
• Nearly 72 percent of the world’s mobile devices run on the Android
platform
• Apps: mobile applications created for smartphones
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 4
1.2 The Role of the Android in the Mobile
Market
• Open-Source Platform
− Android is an open-source operating system—no company or individual
defines the features or direction of the development
− Open Handset Alliance: an open-source business alliance of 80 firms that
develop standards for mobile devices
• Android Open-Source Devices
− Android smartphones, tablets, and smartwatches are sold by many
companies
− As you develop an app, you test it using an emulator, which duplicates
how the app looks and feels on a particular device
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 5
1.3 Features of the Android Phone (1 of 3)
Feature Description
3D graphics The interface can support 3D graphics for a 3D interactive game
experience or 3D image rendering.
Split screen A split-screen, multiwindow feature displays more than one Android
application at the same time. Watch a movie on the left side and hold a
video call with your friends who are also watching the movie.
Dark mode The Dark mode feature helps to save the phone’s battery life. Blank white
space consumes more power and drains the battery.
Facial recognition Android provides this high-level feature for automatically identifying or
verifying a person’s face from a digital image or a video frame.
Front- and rear- Android phones can use either a front- or rear-facing camera, allowing
facing camera developers to create applications involving video calling.
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 6
1.3 Features of the Android Phone (2 of 3)
Feature Description
Multiple language Android supports multiple human languages. Android provides a feature of
voice-to-text converting text to speech in different languages. Text messages can be
support read aloud to help people who are visually impaired.
On-screen keyboard The on-screen keyboard offers suggestions for spelling corrections as well
as options for completing words you start typing. The on-screen keyboard
also supports voice input.
Power management Android identifies programs running in the background that are using
memory and processor resources. You can close those apps to free up the
phone’s processor memory, extending the battery power.
Gaming For optimized gaming, Android supports the use of a gyroscope, gravity
and barometric sensors, linear acceleration, and rotation vectors, which
provide game developers with highly sensitive and responsive controls.
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 7
1.3 Features of the Android Phone (3 of 3)
Feature Description
Voice-based Android recognizes voice actions for calling, texting, and navigating with
recognition the phone.
Wi-Fi Internet Android supports tethering, which allows a phone to be used as a wireless
tethering or wired hotspot that other devices can use to connect to the Internet.
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 8
1.4 Languages Used in Android
Development (1 of 4)
• Java is an object-oriented programming language patterned after the
C++ language
• Java and Kotlin can be used to code Android apps
• Android Studio
− An integrated development environment (IDE) for building and
integrating application development tools and open-source projects
− Installation Includes the Android Software Development Kit (SDK)
and emulator
− XML is used to assist in the layout of the Android emulator
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 9
1.4 Languages Used in Android
Development (2 of 4)
• Android Emulator
− Design, develop, prototype, and test Android apps without using a
physical device
− Mimics almost every feature of a real Android handset, except
placing phone calls
• Versions of Android
− First release was 1.0 (September 2008)
− Each subsequent release adds features and fixes known bugs
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 10
1.4 Languages Used in Android
Development (3 of 4)
Figure 1-4 Android Studio
running Java code
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 11
1.4 Languages Used in Android
Development (4 of 4)
• Versions of Android (continued)
− Android has adopted a naming system based on treats/desserts
− When the revision level reached 10.0, Android started emphasizing
revision numbers over names
− Most recent versions were Android 14.0 (Upside Down Cake, October
2023), Android 15.0 (Vanilla Ice Cream, 2024) and Android 16.0
(Baklava)
− [Link]
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 12
1.5 Google Play in the Marketplace (1 of 2)
• The Android platform consists of the Android OS, application
development tools, and a marketplace for Android applications
• Apps are compiled into package files with an .apk extension
• Google Play ([Link] sells and deploys all apps
• Programs must meet minimum standards, including:
− Reliability
− Efficiency
− Performance
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 13
1.5 Google Play in the Marketplace (2 of 2)
• Developers must sign an agreement and pay a one-time registration fee
(currently $25) to publish apps on Google Play
• Apps offered for free are free to publish
• For paid apps, standard split is 85% of sales for the developer and 15%
for wireless carriers for the first $1 million of annual earnings selling
digital goods or services
• Also sold through the Amazon Appstore
− Pays developers 80% of the sale price for sold apps and grants 10%
of their Appstore revenue as an Amazon Web Services credit
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 14
1.6 The Connection between Windows and
Android
• Beginning with Windows 11, you can download Android apps to your PC
from the Microsoft Store
• Android apps are also available for Windows-based tablets and other
touch devices
• Phone Link App
− The Microsoft Phone Link app allows you to connect an Android
phone to a Windows 11 PC
− Enables text messaging, notifications, and transfer of photos from
the phone on the PC
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 15
1.7 Creating an Android Project Using
Android Studio (1 of 8)
• Install Android Studio from [Link]/studio
• Opening Android Studio to Create a New Project
− Name: the human-readable title for your app
− Package name: the Java package namespace for the source code
− Save location on your hard drive or USB drive
− Minimum SDK: the minimum API level required by your app
− Language (Java or Kotlin)
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 16
1.7 Creating an Android Project Using
Android Studio (2 of 8)
• Creating the Hello Android World Project
− Android Studio facilitates app creation for various form factors
− A form factor is the physical size and shape of a technology device;
for example, smartphones and tablets are of various sizes
− Two most common projects: Empty Activity and Empty Views
Activity
− To create a new Android project, you open Studio, click the New
Project button, and make selections and entries for the project
specs
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 17
1.7 Creating an Android Project Using
Android Studio (3 of 8)
Figure 1-8 Welcome to
Android Studio window
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 18
1.7 Creating an Android Project Using
Android Studio (4 of 8)
New Project ->
Empty Views Activity
Figure 1-9 New Project
window with Empty Activity
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 19
1.7 Creating an Android Project Using
Android Studio (5 of 8)
Figure 1-10 Creating Empty
Activity
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 20
1.7 Creating an Android Project Using
Android Studio (6 of 8)
Figure 1-11 Android Studio
project view
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 21
1.7 Creating an Android Project Using
Android Studio (7 of 8)
• Building the User Interface
− The user interface must be intuitive
− The user interface must not distract from functionality
− Java code or XML layout files are needed
− The XML method is preferred because it allows you to design a user
interface without writing large amounts of code
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 22
1.7 Creating an Android Project Using
Android Studio (8 of 8)
• The Android Project View
− The Android project view contains the key source application
folders for a project: manifests, java, and res
− The manifests folder includes the [Link] file, which
contains all the information about the application that Android
needs to run
− The java folder contains the Java code source files
− The res folder contains resources the app may need: images, music,
video, and the user interface named activity_main.xml
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 23
1.8 The User Interface Layout within the
Virtual Device (1 of 12)
• The Android SDK includes layout files called activity_main.xml in the
res/layout folder of the app
• The Layout Editor contains the Palette, Component Tree, toolbar,
Design editor, and Attributes pane
• Layout: a container that holds as many widgets as needed
• Widget: a single element (a.k.a. object), such as a Button from the
Palette
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 24
1.8 The User Interface Layout within the
Virtual Device (2 of 12)
Figure 1-12 Coding window in
Android Studio
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 25
1.8 The User Interface Layout within the
Virtual Device (3 of 12)
• The Attributes pane contains the attributes and settings of the
currently active app project or object
• Attribute: a characteristic of an object that describes what that object
can do
• Android Studio displays an emulator configuration called the Android
Virtual Device (AVD) for design and layout purposes
• To change the virtual device, you open the activity_main.xml file to
open the Layout Editor, then click the Device for Preview (D) button
and select the desired device
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 26
1.8 The User Interface Layout within the
Virtual Device (4 of 12)
Figure 1-13 Layout Editor for
emulator layout design
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 27
1.8 The User Interface Layout within the
Virtual Device (5 of 12)
Figure 1-14 Device for
Preview button
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 28
1.8 The User Interface Layout within the
Virtual Device (6 of 12)
Figure 1-15 Generic phone
selected for Device for
Preview
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 29
1.8 The User Interface Layout within the
Virtual Device (7 of 12)
• When you select the default TextView component, its text is displayed
in the Component Tree
− The Component Tree displays widgets in the order they were placed
on the emulator
• Within the Common Attributes section of the Attributes pane, you can
see the text attribute of the component, which is the text it contains
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 30
1.8 The User Interface Layout within the
Virtual Device (8 of 12)
Figure 1-16 Design editor
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 31
1.8 The User Interface Layout within the
Virtual Device (9 of 12)
Figure 1-17 Attributes pane
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 32
1.8 The User Interface Layout within the
Virtual Device (10 of 12)
• The TextView Component
− Text can be updated by:
▪ Changing the hard-coded value for the text attribute in the
Attributes pane
▪ Modifying resource files
▪ Changing the application XML source code
− It is good programming practice to add an id attribute to each
component (object) for use in Java code
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 33
1.8 The User Interface Layout within the
Virtual Device (11 of 12)
Figure 1-18 Emulator with
TextView control and text
attribute
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 34
1.8 The User Interface Layout within the
Virtual Device (12 of 12)
Figure 1-19 The id attribute
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 35
1.9 Executing an Android Application on an
Emulator (1 of 2)
• The Android emulator (virtual device) runs slowly
− Even when idling, it consumes significant CPU time
• To run and automatically save your app, click the Run button
• Click the Terminate button to stop the emulator from running
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 36
1.9 Executing an Android Application on an
Emulator (2 of 2)
Figure 1-20 Hello Android
World app displayed in
emulator
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 37
1.10 Opening a Saved Android Project in
Android Studio
• To load a saved project, open Studio and then choose the project to
open
− Click on it in the Recent Projects column or
− Click Open an existing Android Project in the Quick Start column,
navigate to it, and click the OK button
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 38
Summary
• Click the link to review the objectives for this presentation.
Chapter objectives
Hoisington, Android Bootcamp for Developers Using Java, 4th Edition. © 2024 Cengage. All Rights Reserved. May not be
scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 39