Acknowledgments |
|
ix | |
Preface |
|
xi | |
Introduction |
|
xlii | |
|
|
|
1 Initialize The Penny Drop App |
|
|
3 | (24) |
|
|
3 | (1) |
|
|
4 | (8) |
|
|
12 | (13) |
|
|
25 | (2) |
|
2 Build Views With Fragments |
|
|
27 | (30) |
|
Build a Fragment (Pick Players) |
|
|
28 | (8) |
|
Add Data Binding to the App |
|
|
36 | (8) |
|
Build Another Fragment (Game) |
|
|
44 | (12) |
|
|
56 | (1) |
|
3 Bind Data With Viewmodels |
|
|
57 | (34) |
|
Create a ViewModel (Pick Players) |
|
|
57 | (6) |
|
Bind ViewModel to a Fragment (Pick Players) |
|
|
63 | (6) |
|
Add AI Spinner to Player List Items |
|
|
69 | (3) |
|
Customize the Player List Items |
|
|
72 | (5) |
|
Create Another ViewModel (Game) |
|
|
77 | (5) |
|
Bind ViewModel to a Fragment (Game) |
|
|
82 | (7) |
|
|
89 | (2) |
|
4 Update Livedata With Conditional Game Logic |
|
|
91 | (24) |
|
|
92 | (9) |
|
|
101 | (2) |
|
More GameVlewModel Functions: roll() and pass() |
|
|
103 | (1) |
|
|
104 | (2) |
|
|
106 | (3) |
|
Handle AI Turns with Coroutines and First-Class Functions |
|
|
109 | (3) |
|
|
112 | (3) |
|
5 Persist Game Data With Room |
|
|
115 | (36) |
|
|
115 | (1) |
|
|
116 | (2) |
|
|
118 | (1) |
|
|
119 | (5) |
|
Add Data During Database Creation |
|
|
124 | (1) |
|
Add Converters to the Database |
|
|
125 | (3) |
|
Create a Repository Class |
|
|
128 | (5) |
|
Access the Database from a ViewModel |
|
|
133 | (16) |
|
Update the UI Data Binding |
|
|
149 | (1) |
|
|
149 | (2) |
|
6 Build A List With Recyclerview |
|
|
151 | (18) |
|
|
152 | (3) |
|
Build the List Item Layout |
|
|
155 | (5) |
|
Create a Custom ListAdapter |
|
|
160 | (3) |
|
Connect Adapter to RecyclerView |
|
|
163 | (1) |
|
Load Data into RecyclerView from Database |
|
|
164 | (4) |
|
|
168 | (1) |
|
7 Customize An App With Settings And Themes |
|
|
169 | (30) |
|
Add a New SettingsFragment |
|
|
170 | (6) |
|
|
176 | (2) |
|
|
178 | (2) |
|
|
180 | (3) |
|
|
183 | (5) |
|
Add an About the App Section |
|
|
188 | (5) |
|
|
193 | (6) |
|
Part II Android Baseball League |
|
|
|
8 Initialize The Android Baseball League App |
|
|
199 | (16) |
|
Welcome to the Official ABL App |
|
|
199 | (1) |
|
|
200 | (5) |
|
|
205 | (1) |
|
|
206 | (7) |
|
|
213 | (2) |
|
9 Navigate Via Navigation Drawer |
|
|
215 | (20) |
|
Add the Navigation Drawer |
|
|
215 | (7) |
|
Add Fragments (Standings and Single Team) |
|
|
222 | (3) |
|
|
225 | (5) |
|
Navigate Directly via a Deep Link |
|
|
230 | (4) |
|
|
234 | (1) |
|
10 Load And Save Data With Coroutines And Room |
|
|
235 | (24) |
|
|
235 | (6) |
|
|
241 | (4) |
|
Load Data from External APIs |
|
|
245 | (8) |
|
Add a New Fragment (Scoreboard) |
|
|
253 | (5) |
|
|
258 | (1) |
|
11 Display Data With Paging |
|
|
259 | (24) |
|
Add Two New Fragments (Leaders and Single Player) |
|
|
260 | (4) |
|
Add a New Fragment (Players) |
|
|
264 | (2) |
|
Handle Paging Data in the App |
|
|
266 | (11) |
|
Display Paging Data in a RecyclerView List |
|
|
277 | (3) |
|
|
280 | (3) |
|
12 Personalize The Android Baseball League App |
|
|
283 | (22) |
|
Build a Settings Screen via Code |
|
|
284 | (4) |
|
Extract Colors with Palette |
|
|
288 | (6) |
|
Add and Group Additional Preferences |
|
|
294 | (5) |
|
Reliably Complete Background Work with WorkManager |
|
|
299 | (5) |
|
|
304 | (1) |
|
13 Send Info To And From The Android Baseball League App |
|
|
305 | (24) |
|
Alert Users with Notifications |
|
|
305 | (8) |
|
Send Cloud-Based Alerts with Push Notifications |
|
|
313 | (8) |
|
Share Links with Android Sharesheet |
|
|
321 | (4) |
|
|
325 | (4) |
|
|
|
14 Unit Test Your App With Junit |
|
|
329 | (22) |
|
|
330 | (6) |
|
|
336 | (6) |
|
Test a Data Access Object (DAO) |
|
|
342 | (6) |
|
|
348 | (3) |
|
15 Test Your App's Ui With Espresso |
|
|
351 | (16) |
|
|
351 | (7) |
|
|
358 | (5) |
|
|
363 | (4) |
|
|
|
A1 Install Android Studio |
|
|
367 | (14) |
|
|
367 | (1) |
|
|
368 | (8) |
|
Set Up an Android Virtual Device (AVD) |
|
|
376 | (5) |
|
A2 Troubleshooting Your App |
|
|
381 | (14) |
|
|
382 | (4) |
|
Display Messages with the Toast Class |
|
|
386 | (5) |
|
|
391 | (3) |
|
|
394 | (1) |
|
|
395 | (8) |
|
|
395 | (1) |
|
Implementation Dependencies |
|
|
396 | (5) |
|
|
401 | (1) |
|
|
401 | (2) |
Index |
|
403 | |