Table of Contents
About the Author
About the Technical Reviewer
Preface
Introduction
Chapter 1: System
The Android Operating System
The Development System
Android Studio
Virtual Devices
The SDK
Chapter 2: Application
Tasks
The Application Manifest
Chapter 3: Activities
Declaring Activities
Starting Activities
Activities and Tasks
Activities Returning Data
Intent Filters
Intent Action
Intent Category
Intent Data
Intent Extra Data
Intent Flags
System Intent Filters
Activities Lifecycle
Preserving State in Activities
Chapter 4: Services
Foreground Services
Background Services
Declaring Services
Service Classes
Starting Services
Binding to Services
Data Sent by Services
Service Subclasses
Services Lifecycle
More Service Characteristics
Chapter 5: Broadcasts
Explicit Broadcasts
Explicit Local Broadcasts
Explicit Remote Broadcasts
Explicit Broadcasts Sent to Other Apps
Implicit Broadcasts
Intent Filter Matching
Active or On-Hold Listening
Sending Implicit Broadcasts
Receiving Implicit Broadcasts
Listening to System Broadcasts
Adding Security to Broadcasts
Securing Explicit Broadcasts
Securing Implicit Broadcasts
Sending Broadcasts from the Command Line
Random Notes on Broadcasts
Chapter 6: Content Providers
The Content Provider Framework
Providing Content
Initializing the Provider
Querying Data
Modifying Content
Finishing the ContentProvider Class
Registering the Content Provider
Designing Content URIs
Building a Content Interface Contract
A Cursor Class Basing on AbstractCursor and Co.
A Cursor Class Basing on the Cursor Interface
Dispatching URIs Inside the Provider Code
Providing Content Files
Informing Listeners of Data Changes
Extending a Content Provider
Client Access Consistency by URI Canonicalization
Consuming Content
Using the Content Resolver
Accessing System Content Providers
BlockedNumberContract
CalendarContract
CallLog
ContactsContract
DocumentsContract
FontsContract
MediaStore
Settings
SyncStateContract
UserDictionary
VoicemailContract
Batch-Accessing Content Data
Securing Content
Providing Content for the Search Framework
Documents Provider
Chapter 7: Permissions
Permission Types
Defining Permissions
Using Permissions
Acquiring Permissions
System-Managed Permission Requests
Acquiring Special Permissions
Feature Requirements and Permissions
Permission Handling Using a Terminal
Chapter 8: APIs
Databases
Configuring Your Environment for Room
Room Architecture
The Database
Entities
Relationships
Nested Objects
Using Indexes
Data Access: DAOs
Observable Queries
Database Clients
Transactions
Migrating Databases
Scheduling
JobScheduler
AlarmManager
Notifications
Creating and Showing Notifications
Adding Direct Reply
Notification Progress Bar
Expandable Notifications
Rectifying Activity Navigation
Grouping Notifications
Notification Channels
Notification Badges
Contacts
Contacts Framework Internals
Reading Contacts
Writing Contacts
Using Contacts System Activities
Using Quick Contact Badges
Search Framework
The Searchable Configuration
The Searchable Activity
The Search Dialog
The Search Widget
Search Suggestions
Recent Query Suggestions
Custom Suggestions
Location and Maps
Last Known Location
Tracking Position Updates
Geocoding
Using ADB to Fetch Location Information
Maps
Preferences
Chapter 9: User Interface
Background Tasks
Java Concurrency
The AsyncTask Class
Handlers
Loaders
Coroutines
Loading Data in ViewModels
Supporting Multiple Devices
Screen Sizes
Pixel Densities
Declare Restricted Screen Support
Detect Device Capabilities
Programmatic UI Design
Adding Views Manually
Using Jetpack Compose Builders
Adapters and List Controls
Styles and Themes
Fonts in XML
2D Animation
Auto-animating Layouts
Animated Bitmaps
Property Animation
View Property Animator
Spring Physics
Transitions
Start an Activity Using Transitions
Animation in Jetpack Compose
Fast Graphics OpenGL ES
Showing an OpenGL Surface in Your Activity
Creating a Custom OpenGL View Element
A Triangle with a Vertex Buffer
A Quad with a Vertex Buffer and an Index Buffer
Creating and Using a Renderer
Projection
Motion
Light
Textures
User Input
Fast Graphics with Vulkan
UI Design with Movable Items
Menus and Action Bars
Options Menu
Context Menu
Contextual Action Mode
Popup Menus
Progress Bars
Working with Fragments
Creating Fragments
Handling Fragments from Activities
Communicating with Fragments
App Widgets
Drag-and-Drop
Defining Drag Data
Defining a Drag Shadow
Starting a Drag
Listening to Drag Events
Multitouch
Picture-in-Picture Mode
Text-to-Speech
Chapter 10: Firebase
Firebase Cloud Storage
Firebase Cloud Messaging
Chapter 11: Development
Writing Reusable Libraries in Kotlin
Starting a Library Module
Creating the Library
Testing the Library
Using the Library
Publishing the Library
Advanced Listeners Using Kotlin
Multithreading
Compatibility Libraries
Kotlin Best Practices
Functional Programming
Top-Level Functions and Data
Class Extensions
Named Arguments
Scoping Functions
Nullability
Data Classes
Destructuring
Multiline String Literals
Inner Functions and Classes
String Interpolation
Qualified “this”
Delegation
Renamed Imports
Kotlin on JavaScript
Creating a JavaScript Module
Using the JavaScript Module
Chapter 12: Building
Build-Related Files
Module Configuration
Module Common Configuration
Module Build Variants
Build Types
Product Flavors
Source Sets
Running a Build from the Console
Signing
Chapter 13: Communication
ResultReceiver Classes
Communication with Back Ends
Communication with HttpsURLConnection
Networking with Volley
Setting Up a Test Server
Android and NFC
Talking to NFC Tags
Peer-to-Peer NFC Data Exchange
NFC Card Emulation
Android and Bluetooth
A Bluetooth RfComm Server
An Android RfComm Client
Chapter 14: Hardware
Programming with Wearables
Wearables Development
Wearables App User Interface
Wearables Faces
Adding Face Complications
Providing Complication Data
Notifications on Wearables
Controlling App Visibility on Wearables
Authentication in Wear
Voice Capabilities in Wear
Speakers on Wearables
Location in Wear
Data Communication in Wear
Programming with Android TV
Android TV Use Cases
Starting an Android TV Studio Project
Android TV Hardware Features
UI Development for Android TV
Recommendation Channels for Content Search
A Recommendation Row for Content Search
Android TV Content Search
Android TV Games
Android TV Channels
Programming with Android Auto and Automotive OS
Playing and Recording Sound
Short Sound Snippets
Playing Media
Recording Audio
Using the Camera
Taking a Picture
Recording a Video
Writing Your Own Camera App
Android and NFC
Android and Bluetooth
Android Sensors
Retrieving Sensor Capabilities
Listening to Sensor Events
Interacting with Phone Calls
Monitoring Phone State Changes
Initiate a Dialing Process
Create a Phone Call Custom UI
Fingerprint Authentication
Chapter 15: Testing
Unit Tests
Standard Unit Tests
Unit Tests with a Stubbed Android Framework
Unit Tests with a Simulated Android Framework
Unit Tests with Mocking
Integration Tests
Testing Services
Testing Intent Services
Testing Content Providers
Testing Broadcast Receivers
User Interface Tests
Chapter 16: Troubleshooting
Logging
Debugging
Performance Monitoring
Memory Usage Monitoring
Chapter 17: Distributing Apps
Android App Bundle
Your Own App Store
The Google Play Store
Chapter 18: Instant Apps
Developing Instant Apps
Chapter 19: CLI
The SDK Tools
The SDK Build Tools
The SDK Platform Tools
0005491889
Appendix
Text Companion
Manifest Top-Level Entries
The
Element
The Element
The Element
The Element
The Element
The Element
The Element
The Element
The Element
The Element
The Element
The Element
The Element
The Element
The Application Declaration
The Child Element
The Child Element
The Child Element
The Child Element
The Child Element
The Child Element
The Child Element
The Child Element
The Child Element
Activity-Related Manifest Entries
Intent Constituent Parts
Intent Actions
Intent Categories
Intent Extra Data
Intent Flags
The Service Class
Cursor Interface
Administrative Methods
Navigation
Data Retrieval
Listeners
Various
Features
Hardware Features
Audio Hardware Features
Bluetooth Hardware Features
Camera Hardware Features
Device UI Hardware Features
Fingerprint Hardware Features
Gamepad Hardware Features
Infrared Hardware Features
Location Hardware Features
NFC Hardware Features
OpenGL ES Hardware Features
Sensor Hardware Features
Screen Hardware Features
Telephony Hardware Features
Touchscreen Hardware Features
USB Hardware Features
Vulkan Hardware Features
Wi-Fi Hardware Features
Software Features
Communication Software Features
Custom Input Software Features
Device Management Software Features
Media Software Features
Screen Interface Software Features
Permissions
The System Intent Filters
System Broadcasts
User Account
App Widgets
Bluetooth
USB
Power Management
Media
Packages (Apps)
Network
Wi-Fi
Notifications
Telephony
TV
Audio
Booting and Shutdown
Security
Various
0005523267
Index