Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
1. Introduction
1.1 Downloading the Code Samples
1.2 Feedback
1.3 Errata
2. Setting up an Android Studio Development Environment
2.1 System Requirements
2.2 Downloading the Android Studio Package
2.3 Installing Android Studio
2.3.1 Installation on Windows
2.3.2 Installation on macOS
2.3.3 Installation on Linux
2.4 The Android Studio Setup Wizard
2.5 Installing Additional Android SDK Packages
3. Creating an Example Android App in Android Studio
3.1 About the Project
3.2 Creating a New Android Project
3.3 Creating an Activity
3.4 Defining the Project and SDK Settings
3.5 Modifying the Example Application
3.6 Reviewing the Layout and Resource Files
3.7 Adding Interaction
3.8 Summary
4. Creating an Android Virtual Device (AVD) in Android Studio
4.1 About Android Virtual Devices
4.2 Creating a New AVD
4.3 Starting the Emulator
4.4 Running the Application in the AVD
4.5 Run/Debug Configurations
4.6 Stopping a Running Application
4.7 AVD Command-line Creation
4.8 Android Virtual Device Configuration Files
4.9 Moving and Renaming an Android Virtual Device
4.10 Summary
5. Using and Configuring the Android Studio AVD Emulator
5.1 The Emulator Environment
5.2 The Emulator Toolbar Options
5.3 Working in Zoom Mode
5.4 Resizing the Emulator Window
5.5 Extended Control Options
5.5.1 Location
5.5.2 Cellular
5.5.3 Camera
5.5.4 Battery
5.5.5 Phone
5.5.6 Directional Pad
5.5.7 Microphone
5.5.8 Fingerprint
5.5.9 Virtual Sensors
5.5.10 Snapshots
5.5.11 Screen Record
5.5.12 Google Play
5.5.13 Settings
5.5.14 Help
5.6 Working with Snapshots
5.7 Drag and Drop Support
5.8 Configuring Fingerprint Emulation
5.9 Summary
6. A Tour of the Android Studio User Interface
6.1 The Welcome Screen
6.2 The Main Window
6.3 The Tool Windows
6.4 Android Studio Keyboard Shortcuts
6.5 Switcher and Recent Files Navigation
6.6 Changing the Android Studio Theme
6.7 Summary
7. Testing Android Studio Apps on a Physical Android Device
7.1 An Overview of the Android Debug Bridge (ADB)
7.2 Enabling ADB on Android based Devices
7.2.1 macOS ADB Configuration
7.2.2 Windows ADB Configuration
7.2.3 Linux adb Configuration
7.3 Testing the adb Connection
7.4 Summary
8. The Basics of the Android Studio Code Editor
8.1 The Android Studio Editor
8.2 Splitting the Editor Window
8.3 Code Completion
8.4 Statement Completion
8.5 Parameter Information
8.6 Parameter Name Hints
8.7 Code Generation
8.8 Code Folding
8.9 Quick Documentation Lookup
8.10 Code Reformatting
8.11 Finding Sample Code
8.12 Summary
9. An Overview of the Android Architecture
9.1 The Android Software Stack
9.2 The Linux Kernel
9.3 Android Runtime – ART
9.4 Android Libraries
9.4.1 C/C++ Libraries
9.5 Application Framework
9.6 Applications
10. The Anatomy of an Android Application
10.1 Android Activities
10.2 Android Fragments
10.3 Android Intents
10.4 Broadcast Intents
10.5 Broadcast Receivers
10.6 Android Services
10.7 Content Providers
10.8 The Application Manifest
10.9 Application Resources
10.10 Application Context
10.11 Summary
11. Understanding Android Application and Activity Lifecycles
11.1 Android Applications and Resource Management
11.2 Android Process States
11.2.1 Foreground Process
11.2.2 Visible Process
11.2.3 Service Process
11.2.4 Background Process
11.2.5 Empty Process
11.3 Inter-Process Dependencies
11.4 The Activity Lifecycle
12. Handling Android Activity State Changes
12.1 New vs. Old Lifecycle Techniques
12.2 The Activity and Fragment Classes
12.3 Dynamic State vs. Persistent State
12.4 The Android Lifecycle Methods
12.5 Lifetimes
12.6 Disabling Configuration Change Restarts
12.7 Lifecycle Method Limitations
12.8 Summary
13. Android Activity State Changes by Example
13.1 Creating the State Change Example Project
13.2 Designing the User Interface
13.3 Overriding the Activity Lifecycle Methods
13.4 Filtering the Logcat Panel
13.5 Running the Application
13.6 Experimenting with the Activity
13.7 Summary
14. Saving and Restoring the State of an Android Activity
14.1 Saving Dynamic State
14.2 Default Saving of User Interface State
14.3 The Bundle Class
14.4 Saving the State
14.5 Restoring the State
14.6 Testing the Application
14.7 Summary
15. Understanding Android Views, View Groups and Layouts
15.1 Designing for Different Android Devices
15.2 Views and View Groups
15.3 Android Layout Managers
15.4 The View Hierarchy
15.5 Creating User Interfaces
15.6 Summary
16. A Guide to the Android Studio Layout Editor Tool
16.1 Basic vs. Empty Activity Templates
16.2 The Android Studio Layout Editor
16.3 Design Mode
16.4 The Palette
16.5 Design and Layout Views
16.6 Text Mode
16.7 Setting Attributes
16.8 Configuring Favorite Attributes
16.9 Converting Views
16.10 Displaying Sample Data
16.11 Creating a Custom Device Definition
16.12 Changing the Current Device
16.13 Summary
17. A Guide to the Android ConstraintLayout
17.1 How ConstraintLayout Works
17.1.1 Constraints
17.1.2 Margins
17.1.3 Opposing Constraints
17.1.4 Constraint Bias
17.1.5 Chains
17.1.6 Chain Styles
17.2 Baseline Alignment
17.3 Working with Guidelines
18. A Guide to using ConstraintLayout in Android Studio
18.1 Design and Layout Views
18.2 Autoconnect Mode
18.3 Inference Mode
18.4 Manipulating Constraints Manually
18.5 Adding Constraints in the Inspector
18.6 Deleting Constraints
18.7 Adjusting Constraint Bias
18.8 Understanding ConstraintLayout Margins
18.9 The Importance of Opposing Constraints and Bias
18.10 Configuring Widget Dimensions
18.11 Adding Guidelines
18.12 Adding Barriers
18.13 Widget Group Alignment and Distribution
18.14 Converting other Layouts to ConstraintLayout
18.15 Summary
19. Working with ConstraintLayout Chains and Ratios in Android Studio
19.1 Creating a Chain
19.2 Changing the Chain Style
19.3 Spread Inside Chain Style
19.4 Packed Chain Style
19.5 Packed Chain Style with Bias
19.6 Weighted Chain
19.7 Working with Ratios
19.8 Summary
20. An Android Studio Layout Editor ConstraintLayout Tutorial
20.1 An Android Studio Layout Editor Tool Example
20.2 Creating a New Activity
20.3 Preparing the Layout Editor Environment
20.4 Adding the Widgets to the User Interface
20.5 Adding the Constraints
20.6 Testing the Layout
20.7 Using the Layout Inspector
20.8 Summary
21. Manual XML Layout Design in Android Studio
21.1 Manually Creating an XML Layout
21.2 Manual XML vs. Visual Layout Design
21.3 Summary
22. Managing Constraints using Constraint Sets
22.1 Java Code vs. XML Layout Files
22.2 Creating Views
22.3 View Attributes
22.4 Constraint Sets
22.4.1 Establishing Connections
22.4.2 Applying Constraints to a Layout
22.4.3 Parent Constraint Connections
22.4.4 Sizing Constraints
22.4.5 Constraint Bias
22.4.6 Alignment Constraints
22.4.7 Copying and Applying Constraint Sets
22.4.8 ConstraintLayout Chains
22.4.9 Guidelines
22.4.10 Removing Constraints
22.4.11 Scaling
22.4.12 Rotation
22.5 Summary
23. An Android ConstraintSet Tutorial
23.1 Creating the Example Project in Android Studio
23.2 Adding Views to an Activity
23.3 Setting View Attributes
23.4 Creating View IDs
23.5 Configuring the Constraint Set
23.6 Adding the EditText View
23.7 Converting Density Independent Pixels (dp) to Pixels (px)
23.8 Summary
24. A Guide to using Instant Run in Android Studio
24.1 Introducing Instant Run
24.2 Understanding Instant Run Swapping Levels
24.3 Enabling and Disabling Instant Run
24.4 Using Instant Run
24.5 An Instant Run Tutorial
24.6 Triggering an Instant Run Hot Swap
24.7 Triggering an Instant Run Warm Swap
24.8 Triggering an Instant Run Cold Swap
24.9 The Run Button
24.10 Summary
25. An Overview and Example of Android Event Handling
25.1 Understanding Android Events
25.2 Using the android:onClick Resource
25.3 Event Listeners and Callback Methods
25.4 An Event Handling Example
25.5 Designing the User Interface
25.6 The Event Listener and Callback Method
25.7 Consuming Events
25.8 Summary
26. Android Touch and Multi-touch Event Handling
26.1 Intercepting Touch Events
26.2 The MotionEvent Object
26.3 Understanding Touch Actions
26.4 Handling Multiple Touches
26.5 An Example Multi-Touch Application
26.6 Designing the Activity User Interface
26.7 Implementing the Touch Event Listener
26.8 Running the Example Application
26.9 Summary
27. Detecting Common Gestures using the Android Gesture Detector Class
27.1 Implementing Common Gesture Detection
27.2 Creating an Example Gesture Detection Project
27.3 Implementing the Listener Class
27.4 Creating the GestureDetectorCompat Instance
27.5 Implementing the onTouchEvent() Method
27.6 Testing the Application
27.7 Summary
28. Implementing Custom Gesture and Pinch Recognition on Android
28.1 The Android Gesture Builder Application
28.2 The GestureOverlayView Class
28.3 Detecting Gestures
28.4 Identifying Specific Gestures
28.5 Building and Running the Gesture Builder Application
28.6 Creating a Gestures File
28.7 Creating the Example Project
28.8 Extracting the Gestures File from the SD Card
28.9 Adding the Gestures File to the Project
28.10 Designing the User Interface
28.11 Loading the Gestures File
28.12 Registering the Event Listener
28.13 Implementing the onGesturePerformed Method
28.14 Testing the Application
28.15 Configuring the GestureOverlayView
28.16 Intercepting Gestures
28.17 Detecting Pinch Gestures
28.18 A Pinch Gesture Example Project
28.19 Summary
29. An Introduction to Android Fragments
29.1 What is a Fragment?
29.2 Creating a Fragment
29.3 Adding a Fragment to an Activity using the Layout XML File
29.4 Adding and Managing Fragments in Code
29.5 Handling Fragment Events
29.6 Implementing Fragment Communication
29.7 Summary
30. Using Fragments in Android Studio - An Example
30.1 About the Example Fragment Application
30.2 Creating the Example Project
30.3 Creating the First Fragment Layout
30.4 Creating the First Fragment Class
30.5 Creating the Second Fragment Layout
30.6 Adding the Fragments to the Activity
30.7 Making the Toolbar Fragment Talk to the Activity
30.8 Making the Activity Talk to the Text Fragment
30.9 Testing the Application
30.10 Summary
31. Modern Android App Architecture with Jetpack
31.1 What is Android Jetpack?
31.2 The “Old” Architecture
31.3 Modern Android Architecture
31.4 The ViewModel Component
31.5 The LiveData Component
31.6 LiveData and Data Binding
31.7 Android Lifecycles
31.8 Repository Modules
31.9 Summary
32. An Android Jetpack ViewModel Tutorial
32.1 About the Project
32.2 Creating the ViewModel Example Project
32.3 Reviewing the Project
32.3.1 The Main Activity
32.3.2 The Content Fragment
32.3.3 The ViewModel
32.4 Designing the Fragment Layout
32.5 Implementing the View Model
32.6 Associating the Fragment with the View Model
32.7 Modifying the Fragment
33. An Android Jetpack LiveData Tutorial
33.1 LiveData - A Recap
33.2 Adding LiveData to the ViewModel
33.3 Implementing the Observer
33.4 Summary
34. An Overview of Android Jetpack Data Binding
34.1 An Overview of Data Binding
34.2 The Key Components of Data Binding
34.2.1 The Project Build Configuration
34.2.2 The Data Binding Layout File
34.2.3 The Layout File Data Element
34.2.4 The Binding Classes
34.2.5 Data Binding Variable Configuration
34.2.6 Binding Expressions (One-Way)
34.2.7 Binding Expressions (Two-Way)
34.2.8 Event and Listener Bindings
34.3 Summary
35. An Android Jetpack Data Binding Tutorial
35.1 Removing the Redundant Code
35.2 Enabling Data Binding
35.3 Adding the Layout Element
35.4 Adding the Data Element to Layout File
35.5 Working with the Binding Class
35.6 Assigning the ViewModel Instance to the Data Binding Variable
35.7 Adding Binding Expressions
35.8 Adding the Conversion Method
35.9 Adding a Listener Binding
35.10 Testing the App
35.11 Summary
36. Working with Android Lifecycle-Aware Components
36.1 Lifecycle Awareness
36.2 Lifecycle Owners
36.3 Lifecycle Observers
36.4 Lifecycle States and Events
36.5 Summary
37. An Android Jetpack Lifecycle Awareness Tutorial
37.1 Creating the Example Lifecycle Project
37.2 Creating a Lifecycle Observer
37.3 Adding the Observer
37.4 Testing the Observer
37.5 Creating a Lifecycle Owner
37.6 Testing the Custom Lifecycle Owner
37.7 Summary
38. An Overview of the Navigation Architecture Component
38.1 Understanding Navigation
38.2 Declaring a Navigation Host
38.3 The Navigation Graph
38.4 Accessing the Navigation Controller
38.5 Triggering a Navigation Action
38.6 Passing Arguments
38.7 Summary
39. An Android Jetpack Navigation Component Tutorial
39.1 Creating the NavigationDemo Project
39.2 Adding Navigation to the Build Configuration
39.3 Creating the Navigation Graph Resource File
39.4 Declaring a Navigation Host
39.5 Adding Navigation Destinations
39.6 Designing the Destination Fragment Layouts
39.7 Adding an Action to the Navigation Graph
39.8 Implement the OnFragmentInteractionListener
39.9 Triggering the Action
39.10 Passing Data Using Safeargs
39.11 Summary
40. Creating and Managing Overflow Menus on Android
40.1 The Overflow Menu
40.2 Creating an Overflow Menu
40.3 Displaying an Overflow Menu
40.4 Responding to Menu Item Selections
40.5 Creating Checkable Item Groups
40.6 Menus and the Android Studio Menu Editor
40.7 Creating the Example Project
40.8 Designing the Menu
40.9 Modifying the onOptionsItemSelected() Method
40.10 Testing the Application
40.11 Summary
41. Animating User Interfaces with the Android Transitions Framework
41.1 Introducing Android Transitions and Scenes
41.2 Using Interpolators with Transitions
41.3 Working with Scene Transitions
41.4 Custom Transitions and TransitionSets in Code
41.5 Custom Transitions and TransitionSets in XML
41.6 Working with Interpolators
41.7 Creating a Custom Interpolator
41.8 Using the beginDelayedTransition Method
41.9 Summary
42. An Android Transition Tutorial using beginDelayedTransition
42.1 Creating the Android Studio TransitionDemo Project
42.2 Preparing the Project Files
42.3 Implementing beginDelayedTransition Animation
42.4 Customizing the Transition
42.5 Summary
43. Implementing Android Scene Transitions – A Tutorial
43.1 An Overview of the Scene Transition Project
43.2 Creating the Android Studio SceneTransitions Project
43.3 Identifying and Preparing the Root Container
43.4 Designing the First Scene
43.5 Designing the Second Scene
43.6 Entering the First Scene
43.7 Loading Scene 2
43.8 Implementing the Transitions
43.9 Adding the Transition File
43.10 Loading and Using the Transition Set
43.11 Configuring Additional Transitions
43.12 Summary
44. Working with the Floating Action Button and Snackbar
44.1 The Material Design
44.2 The Design Library
44.3 The Floating Action Button (FAB)
44.4 The Snackbar
44.5 Creating the Example Project
44.6 Reviewing the Project
44.7 Changing the Floating Action Button
44.8 Adding the ListView to the Content Layout
44.9 Adding Items to the ListView
44.10 Adding an Action to the Snackbar
44.11 Summary
45. Creating a Tabbed Interface using the TabLayout Component
45.1 An Introduction to the ViewPager
45.2 An Overview of the TabLayout Component
45.3 Creating the TabLayoutDemo Project
45.4 Creating the First Fragment
45.5 Duplicating the Fragments
45.6 Adding the TabLayout and ViewPager
45.7 Creating the Pager Adapter
45.8 Performing the Initialization Tasks
45.9 Testing the Application
45.10 Customizing the TabLayout
45.11 Displaying Icon Tab Items
45.12 Summary
46. Working with the RecyclerView and CardView Widgets
46.1 An Overview of the RecyclerView
46.2 An Overview of the CardView
46.3 Adding the Libraries to the Project
46.4 Summary
47. An Android RecyclerView and CardView Tutorial
47.1 Creating the CardDemo Project
47.2 Removing the Floating Action Button
47.3 Adding the RecyclerView and CardView Libraries
47.4 Designing the CardView Layout
47.5 Adding the RecyclerView
47.6 Creating the RecyclerView Adapter
47.7 Adding the Image Files
47.8 Initializing the RecyclerView Component
47.9 Testing the Application
47.10 Responding to Card Selections
47.11 Summary
48. A Layout Editor Sample Data Tutorial
48.1 Adding Sample Data to a Project
48.2 Using Custom Sample Data
48.3 Summary
49. Working with the AppBar and Collapsing Toolbar Layouts
49.1 The Anatomy of an AppBar
49.2 The Example Project
49.3 Coordinating the RecyclerView and Toolbar
49.4 Introducing the Collapsing Toolbar Layout
49.5 Changing the Title and Scrim Color
49.6 Summary
50. Implementing an Android Navigation Drawer
50.1 An Overview of the Navigation Drawer
50.2 Opening and Closing the Drawer
50.3 Responding to Drawer Item Selections
50.4 Using the Navigation Drawer Activity Template
50.5 Creating the Navigation Drawer Template Project
50.6 The Template Layout Resource Files
50.7 The Header Coloring Resource File
50.8 The Template Menu Resource File
50.9 The Template Code
50.10 Running the App
50.11 Summary
51. An Android Studio Master/Detail Flow Tutorial
51.1 The Master/Detail Flow
51.2 Creating a Master/Detail Flow Activity
51.3 The Anatomy of the Master/Detail Flow Template
51.4 Modifying the Master/Detail Flow Template
51.5 Changing the Content Model
51.6 Changing the Detail Pane
51.7 Modifying the WebsiteDetailFragment Class
51.8 Modifying the WebsiteListActivity Class
51.9 Adding Manifest Permissions
51.10 Running the Application
51.11 Summary
52. An Overview of Android Intents
52.1 An Overview of Intents
52.2 Explicit Intents
52.3 Returning Data from an Activity
52.4 Implicit Intents
52.5 Using Intent Filters
52.6 Checking Intent Availability
52.7 Summary
53. Android Explicit Intents – A Worked Example
53.1 Creating the Explicit Intent Example Application
53.2 Designing the User Interface Layout for MainActivity
53.3 Creating the Second Activity Class
53.4 Designing the User Interface Layout for ActivityB
53.5 Reviewing the Application Manifest File
53.6 Creating the Intent
53.7 Extracting Intent Data
53.8 Launching ActivityB as a Sub-Activity
53.9 Returning Data from a Sub-Activity
53.10 Testing the Application
53.11 Summary
54. Android Implicit Intents – A Worked Example
54.1 Creating the Android Studio Implicit Intent Example Project
54.2 Designing the User Interface
54.3 Creating the Implicit Intent
54.4 Adding a Second Matching Activity
54.5 Adding the Web View to the UI
54.6 Obtaining the Intent URL
54.7 Modifying the MyWebView Project Manifest File
54.8 Installing the MyWebView Package on a Device
54.9 Testing the Application
54.10 Summary
55. Android Broadcast Intents and Broadcast Receivers
55.1 An Overview of Broadcast Intents
55.2 An Overview of Broadcast Receivers
55.3 Obtaining Results from a Broadcast
55.4 Sticky Broadcast Intents
55.5 The Broadcast Intent Example
55.6 Creating the Example Application
55.7 Creating and Sending the Broadcast Intent
55.8 Creating the Broadcast Receiver
55.9 Registering the Broadcast Receiver
55.10 Testing the Broadcast Example
55.11 Listening for System Broadcasts
55.12 Summary
56. A Basic Overview of Threads and AsyncTasks
56.1 An Overview of Threads
56.2 The Application Main Thread
56.3 Thread Handlers
56.4 A Basic AsyncTask Example
56.5 Subclassing AsyncTask
56.6 Testing the App
56.7 Canceling a Task
56.8 Summary
57. An Overview of Android Started and Bound Services
57.1 Started Services
57.2 Intent Service
57.3 Bound Service
57.4 The Anatomy of a Service
57.5 Controlling Destroyed Service Restart Options
57.6 Declaring a Service in the Manifest File
57.7 Starting a Service Running on System Startup
57.8 Summary
58. Implementing an Android Started Service – A Worked Example
58.1 Creating the Example Project
58.2 Creating the Service Class
58.3 Adding the Service to the Manifest File
58.4 Starting the Service
58.5 Testing the IntentService Example
58.6 Using the Service Class
58.7 Creating the New Service
58.8 Modifying the User Interface
58.9 Running the Application
58.10 Creating an AsyncTask for Service Tasks
58.11 Summary
59. Android Local Bound Services – A Worked Example
59.1 Understanding Bound Services
59.2 Bound Service Interaction Options
59.3 An Android Studio Local Bound Service Example
59.4 Adding a Bound Service to the Project
59.5 Implementing the Binder
59.6 Binding the Client to the Service
59.7 Completing the Example
59.8 Testing the Application
59.9 Summary
60. Android Remote Bound Services – A Worked Example
60.1 Client to Remote Service Communication
60.2 Creating the Example Application
60.3 Designing the User Interface
60.4 Implementing the Remote Bound Service
60.5 Configuring a Remote Service in the Manifest File
60.6 Launching and Binding to the Remote Service
60.7 Sending a Message to the Remote Service
60.8 Summary
61. An Android Notifications Tutorial
61.1 An Overview of Notifications
61.2 Creating the NotifyDemo Project
61.3 Designing the User Interface
61.4 Creating the Second Activity
61.5 Creating a Notification Channel
61.6 Creating and Issuing a Basic Notification
61.7 Launching an Activity from a Notification
61.8 Adding Actions to a Notification
61.9 Bundled Notifications
61.10 Summary
62. An Android Direct Reply Notification Tutorial
62.1 Creating the DirectReply Project
62.2 Designing the User Interface
62.3 Creating the Notification Channel
62.4 Building the RemoteInput Object
62.5 Creating the PendingIntent
62.6 Creating the Reply Action
62.7 Receiving Direct Reply Input
62.8 Updating the Notification
62.9 Summary
63. An Introduction to Android Multi-Window Support
63.1 Split-Screen, Freeform and Picture-in-Picture Modes
63.2 Entering Multi-Window Mode
63.3 Enabling Freeform Support
63.4 Checking for Freeform Support
63.5 Enabling Multi-Window Support in an App
63.6 Specifying Multi-Window Attributes
63.7 Detecting Multi-Window Mode in an Activity
63.8 Receiving Multi-Window Notifications
63.9 Launching an Activity in Multi-Window Mode
63.10 Configuring Freeform Activity Size and Position
63.11 Summary
64. An Android Studio Multi-Window Split-Screen and Freeform Tutorial
64.1 Creating the Multi-Window Project
64.2 Designing the MainActivity User Interface
64.3 Adding the Second Activity
64.4 Launching the Second Activity
64.5 Enabling Multi-Window Mode
64.6 Testing Multi-Window Support
64.7 Launching the Second Activity in a Different Window
64.8 Summary
65. An Overview of Android SQLite Databases
65.1 Understanding Database Tables
65.2 Introducing Database Schema
65.3 Columns and Data Types
65.4 Database Rows
65.5 Introducing Primary Keys
65.6 What is SQLite?
65.7 Structured Query Language (SQL)
65.8 Trying SQLite on an Android Virtual Device (AVD)
65.9 The Android Room Persistence Library
65.10 Summary
66. The Android Room Persistence Library
66.1 Revisiting Modern App Architecture
66.2 Key Elements of Room Database Persistence
66.2.1 Repository
66.2.2 Room Database
66.2.3 Data Access Object (DAO)
66.2.4 Entities
66.2.5 SQLite Database
66.3 Understanding Entities
67. An Android TableLayout and TableRow Tutorial
67.1 The TableLayout and TableRow Layout Views
67.2 Creating the Room Database Project
67.3 Converting to a LinearLayout
67.4 Adding the TableLayout to the User Interface
67.5 Configuring the TableRows
67.6 Adding the Button Bar to the Layout
67.7 Adding the RecyclerView
67.8 Adjusting the Layout Margins
67.9 Summary
68. An Android Room Database and Repository Tutorial
68.1 About the RoomDemo Project
68.2 Modifying the Build Configuration
68.3 Building the Entity
68.4 Creating the Data Access Object
68.5 Adding the Room Database
68.6 Adding the Repository
68.7 Modifying the ViewModel
68.8 Creating the Product Item Layout
68.9 Adding the RecyclerView Adapter
68.10 Preparing the Main Fragment
68.11 Adding the Button Listeners
68.12 Adding LiveData Observers
68.13 Initializing the RecyclerView
68.14 Testing the RoomDemo App
68.15 Summary
69. Accessing Cloud Storage using the Android Storage Access Framework
69.1 The Storage Access Framework
69.2 Working with the Storage Access Framework
69.3 Filtering Picker File Listings
69.4 Handling Intent Results
69.5 Reading the Content of a File
69.6 Writing Content to a File
69.7 Deleting a File
69.8 Gaining Persistent Access to a File
69.9 Summary
70. An Android Storage Access Framework Example
70.1 About the Storage Access Framework Example
70.2 Creating the Storage Access Framework Example
70.3 Designing the User Interface
70.4 Declaring Request Codes
70.5 Creating a New Storage File
70.6 The onActivityResult() Method
70.7 Saving to a Storage File
70.8 Opening and Reading a Storage File
70.9 Testing the Storage Access Application
70.10 Summary
71. Implementing Video Playback on Android using the VideoView and MediaController Classes
71.1 Introducing the Android VideoView Class
71.2 Introducing the Android MediaController Class
71.3 Creating the Video Playback Example
71.4 Designing the VideoPlayer Layout
71.5 Configuring the VideoView
71.6 Adding Internet Permission
71.7 Adding the MediaController to the Video View
71.8 Setting up the onPreparedListener
71.9 Summary
72. Android Picture-in-Picture Mode
72.1 Picture-in-Picture Features
72.2 Enabling Picture-in-Picture Mode
72.3 Configuring Picture-in-Picture Parameters
72.4 Entering Picture-in-Picture Mode
72.5 Detecting Picture-in-Picture Mode Changes
72.6 Adding Picture-in-Picture Actions
72.7 Summary
73. An Android Picture-in-Picture Tutorial
73.1 Adding Picture-in-Picture Support to the Manifest
73.2 Adding a Picture-in-Picture Button
73.3 Entering Picture-in-Picture Mode
73.4 Detecting Picture-in-Picture Mode Changes
73.5 Adding a Broadcast Receiver
73.6 Adding the PiP Action
73.7 Testing the Picture-in-Picture Action
73.8 Summary
74. Video Recording and Image Capture on Android using Camera Intents
74.1 Checking for Camera Support
74.2 Calling the Video Capture Intent
74.3 Calling the Image Capture Intent
74.4 Creating an Android Studio Video Recording Project
74.5 Designing the User Interface Layout
74.6 Checking for the Camera
74.7 Launching the Video Capture Intent
74.8 Handling the Intent Return
74.9 Testing the Application
74.10 Summary
75. Making Runtime Permission Requests in Android
75.1 Understanding Normal and Dangerous Permissions
75.2 Creating the Permissions Example Project
75.3 Checking for a Permission
75.4 Requesting Permission at Runtime
75.5 Providing a Rationale for the Permission Request
75.6 Testing the Permissions App
75.7 Summary
76. Android Audio Recording and Playback using MediaPlayer and MediaRecorder
76.1 Playing Audio
76.2 Recording Audio and Video using the MediaRecorder Class
76.3 About the Example Project
76.4 Creating the AudioApp Project
76.5 Designing the User Interface
76.6 Checking for Microphone Availability
76.7 Performing the Activity Initialization
76.8 Implementing the recordAudio() Method
76.9 Implementing the stopAudio() Method
76.10 Implementing the playAudio() method
76.11 Configuring and Requesting Permissions
76.12 Testing the Application
76.13 Summary
77. Working with the Google Maps Android API in Android Studio
77.1 The Elements of the Google Maps Android API
77.2 Creating the Google Maps Project
77.3 Obtaining Your Developer Signature
77.4 Adding the Apache HTTP Legacy Library Requirement
77.5 Testing the Application
77.6 Understanding Geocoding and Reverse Geocoding
77.7 Adding a Map to an Application
77.8 Requesting Current Location Permission
77.9 Displaying the User’s Current Location
77.10 Changing the Map Type
77.11 Displaying Map Controls to the User
77.12 Handling Map Gesture Interaction
77.12.1 Map Zooming Gestures
77.12.2 Map Scrolling/Panning Gestures
77.12.3 Map Tilt Gestures
77.12.4 Map Rotation Gestures
77.13 Creating Map Markers
77.14 Controlling the Map Camera
77.15 Summary
78. Printing with the Android Printing Framework
78.1 The Android Printing Architecture
78.2 The Print Service Plugins
78.3 Google Cloud Print
78.4 Printing to Google Drive
78.5 Save as PDF
78.6 Printing from Android Devices
78.7 Options for Building Print Support into Android Apps
78.7.1 Image Printing
78.7.2 Creating and Printing HTML Content
78.7.3 Printing a Web Page
78.7.4 Printing a Custom Document
78.8 Summary
79. An Android HTML and Web Content Printing Example
79.1 Creating the HTML Printing Example Application
79.2 Printing Dynamic HTML Content
79.3 Creating the Web Page Printing Example
79.4 Removing the Floating Action Button
79.5 Designing the User Interface Layout
79.6 Loading the Web Page into the WebView
79.7 Adding the Print Menu Option
79.8 Summary
80. A Guide to Android Custom Document Printing
80.1 An Overview of Android Custom Document Printing
80.1.1 Custom Print Adapters
80.2 Preparing the Custom Document Printing Project
80.3 Creating the Custom Print Adapter
80.4 Implementing the onLayout() Callback Method
80.5 Implementing the onWrite() Callback Method
80.6 Checking a Page is in Range
80.7 Drawing the Content on the Page Canvas
80.8 Starting the Print Job
80.9 Testing the Application
81. An Introduction to Android App Links
81.1 An Overview of Android App Links
81.2 App Link Intent Filters
81.3 Handling App Link Intents
81.4 Associating the App with a Website
81.5 Summary
82. An Android Studio App Links Tutorial
82.1 About the Example App
82.2 The Database Schema
82.3 Loading and Running the Project
82.4 Adding the URL Mapping
82.5 Adding the Intent Filter
82.6 Adding Intent Handling Code
82.7 Testing the App Link
82.8 Associating an App Link with a Web Site
82.9 Summary
83. An Introduction to Android Instant Apps
83.1 An Overview of Android Instant Apps
83.2 Instant App Feature Modules
83.3 Instant App Project Structure
83.4 The Application and Feature Build Plugins
83.5 Installing the Instant Apps Development SDK
83.6 Summary
84. An Android Instant App Tutorial
84.1 Creating the Instant App Project
84.2 Reviewing the Project
84.3 Testing the Installable App
84.4 Testing the Instant App
84.5 Reviewing the Instant App APK Files
84.6 Summary
85. Adapting an Android Studio Project for Instant Apps
85.1 Getting Started
85.2 Creating the Base Feature Module
85.3 Adding the Application APK Module
85.4 Adding an Instant App Module
85.5 Testing the Instant App
85.6 Summary
86. A Guide to the Android Studio Profiler
86.1 Accessing the Android Profiler
86.2 Enabling Advanced Profiling
86.3 The Android Profiler Tool Window
86.4 The Sessions Panel
86.5 The CPU Profiler
86.6 Memory Profiler
86.7 Network Profiler
86.8 Energy Profiler
86.9 Summary
87. An Android Biometric Authentication Tutorial
87.1 An Overview of Biometric Authentication
87.2 Creating the Biometric Authentication Project
87.3 Configuring Device Fingerprint Authentication
87.4 Adding the Biometric Permission to the Manifest File
87.5 Designing the User Interface
87.6 Adding a Toast Convenience Method
87.7 Checking the Security Settings
87.8 Configuring the Authentication Callbacks
87.9 Adding the CancellationSignal
87.10 Starting the Biometric Prompt
87.11 Testing the Project
87.12 Summary
88. Creating, Testing and Uploading an Android App Bundle
88.1 The Release Preparation Process
88.2 Android App Bundles
88.3 Register for a Google Play Developer Console Account
88.4 Configuring the App in the Console
88.5 Enabling Google Play App Signing
88.6 Enabling ProGuard
88.7 Creating a Keystore File
88.8 Creating the Android App Bundle
88.9 Generating Test APK Files
88.10 Uploading the App Bundle to the Google Play Developer Console
88.11 Exploring the App Bundle
88.12 Managing Testers
88.13 Uploading Instant App Bundles
88.14 Uploading New App Bundle Revisions
88.15 Analyzing the App Bundle File
88.16 Enabling Google Play Signing for an Existing App
88.17 Summary
89. An Overview of Gradle in Android Studio
89.1 An Overview of Gradle
89.2 Gradle and Android Studio
89.2.1 Sensible Defaults
89.2.2 Dependencies
89.2.3 Build Variants
89.2.4 Manifest Entries
89.2.5 APK Signing
89.2.6 ProGuard Support
89.3 The Top-level Gradle Build File
89.4 Module Level Gradle Build Files
89.5 Configuring Signing Settings in the Build File
89.6 Running Gradle Tasks from the Command-line
89.7 Summary
Index
2.6 Making the Android SDK Tools Command-line Accessible
2.6.1 Windows 7
2.6.2 Windows 8.1
2.6.3 Windows 10
2.6.4 Linux
2.6.5 macOS
2.7 Updating Android Studio and the SDK
2.8 Summary
9.7 Summary
11.5 The Activity Stack
11.6 Activity States
11.7 Configuration Changes
11.8 Handling State Change
11.9 Summary
17.4 Configuring Widget Dimensions
17.5 Working with Barriers
17.6 Ratios
17.7 ConstraintLayout Advantages
17.8 ConstraintLayout Availability
17.9 Summary
32.8 Accessing the ViewModel Data
32.9 Testing the Project
32.10 Summary
66.4 Data Access Objects
66.5 The Room Database
66.6 The Repository
66.7 In-Memory Databases
66.8 Summary
80.10 Summary
← Prev
Back
Next →
← Prev
Back
Next →