Introduction |
|
xvii | |
Chapter 1 Getting Started With Android Programming |
|
1 | (28) |
|
|
2 | (6) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
Android Devices in the Market |
|
|
4 | (3) |
|
|
7 | (1) |
|
Obtaining the Required Tools |
|
|
8 | (16) |
|
|
8 | (6) |
|
|
14 | (1) |
|
Creating Android Virtual Devices (AVDs) |
|
|
15 | (9) |
|
The Android Developer Community |
|
|
24 | (1) |
|
Launching Your First Android Application |
|
|
24 | (2) |
|
|
26 | (3) |
Chapter 2 Using Android Studio For Android Development |
|
29 | (18) |
|
|
30 | (8) |
|
|
38 | (1) |
|
Debugging Your Application |
|
|
39 | (5) |
|
|
39 | (4) |
|
|
43 | (1) |
|
Publishing Your Application |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
45 | (2) |
Chapter 3 Activities, Fragments, And Intents |
|
47 | (54) |
|
|
48 | (13) |
|
Applying Styles and Themes to an Activity |
|
|
53 | (1) |
|
Hiding the Activity Title |
|
|
54 | (2) |
|
Displaying a Dialog Window |
|
|
56 | (3) |
|
Displaying a Progress Dialog |
|
|
59 | (2) |
|
Linking Activities Using Intents |
|
|
61 | (14) |
|
Returning Results from an Intent |
|
|
66 | (4) |
|
Passing Data Using an Intent Object |
|
|
70 | (5) |
|
|
75 | (19) |
|
Adding Fragments Dynamically |
|
|
81 | (3) |
|
|
84 | (4) |
|
Interactions Between Fragments |
|
|
88 | (4) |
|
Understanding the Intent Object |
|
|
92 | (1) |
|
|
93 | (1) |
|
|
94 | (4) |
|
|
98 | (3) |
Chapter 4 Getting To Know The Android User Interface |
|
101 | (46) |
|
Understanding the Components of a Screen |
|
|
102 | (22) |
|
|
103 | (1) |
|
|
104 | (1) |
|
LinearLayout (Horizontal) and LinearLayout (Vertical) |
|
|
104 | (10) |
|
|
114 | (2) |
|
|
116 | (1) |
|
|
117 | (4) |
|
|
121 | (3) |
|
Adapting to Display Orientation |
|
|
124 | (3) |
|
|
125 | (2) |
|
Managing Changes to Screen Orientation |
|
|
127 | (6) |
|
Persisting State Information During Changes in Configuration |
|
|
131 | (1) |
|
Detecting Orientation Changes |
|
|
132 | (1) |
|
Controlling the Orientation of the Activity |
|
|
132 | (1) |
|
|
133 | (9) |
|
Adding Action Items to the Action Bar |
|
|
136 | (6) |
|
Creating the User Interface Programmatically |
|
|
142 | (3) |
|
Listening for UI Notifications |
|
|
145 | (1) |
|
|
145 | (2) |
Chapter 5 Designing Your User Interface With Views |
|
147 | (56) |
|
|
148 | (19) |
|
|
148 | (1) |
|
Button, ImageButton, EditText, CheckBox, ToggleButton, RadioButton, and RadioGroup Views |
|
|
149 | (9) |
|
|
158 | (6) |
|
AutoCompleteTextView View |
|
|
164 | (3) |
|
|
167 | (8) |
|
|
167 | (5) |
|
|
172 | (3) |
|
Using List Views to Display Long Lists |
|
|
175 | (11) |
|
|
175 | (9) |
|
|
184 | (2) |
|
Understanding Specialized Fragments |
|
|
186 | (13) |
|
|
187 | (4) |
|
|
191 | (3) |
|
Using a PreferenceFragment |
|
|
194 | (5) |
|
|
199 | (4) |
Chapter 6 Displaying Pictures And Menus With Views |
|
203 | (28) |
|
Using Image Views to Display Pictures |
|
|
203 | (12) |
|
|
204 | (2) |
|
|
206 | (5) |
|
|
211 | (4) |
|
|
215 | (10) |
|
Creating the Helper Methods |
|
|
215 | (2) |
|
|
217 | (3) |
|
|
220 | (5) |
|
|
225 | (3) |
|
|
225 | (3) |
|
|
228 | (3) |
Chapter 7 Data Persistence |
|
231 | (38) |
|
Saving and Loading User Preferences |
|
|
232 | (14) |
|
Accessing Preferences Using an Activity |
|
|
232 | (10) |
|
Programmatically Retrieving and Modifying the Preferences Values |
|
|
242 | (4) |
|
|
246 | (8) |
|
Saving to Internal Storage |
|
|
246 | (4) |
|
Saving to External Storage (SD Card) |
|
|
250 | (3) |
|
Choosing the Best Storage Option |
|
|
253 | (1) |
|
Creating and Using Databases |
|
|
254 | (12) |
|
Creating the DBAdapter Helper Class |
|
|
254 | (6) |
|
Using the Database Programmatically |
|
|
260 | (6) |
|
|
266 | (3) |
Chapter 8 Content Providers |
|
269 | (28) |
|
|
270 | (1) |
|
|
271 | (10) |
|
Predefined Query String Constants |
|
|
278 | (1) |
|
|
279 | (1) |
|
|
280 | (1) |
|
|
280 | (1) |
|
Creating Your Own Content Providers |
|
|
281 | (8) |
|
Using the Content Provider |
|
|
289 | (5) |
|
|
294 | (3) |
Chapter 9 Messaging |
|
297 | (28) |
|
|
298 | (21) |
|
Sending SMS Messages Programmatically |
|
|
298 | (4) |
|
Sending SMS Messages Using Intent |
|
|
302 | (1) |
|
|
302 | (16) |
|
|
318 | (1) |
|
|
319 | (3) |
|
|
322 | (3) |
Chapter 10 Location-Based Services |
|
325 | (26) |
|
|
326 | (14) |
|
|
326 | (1) |
|
Obtaining the Maps API Key |
|
|
326 | (1) |
|
|
327 | (2) |
|
Displaying the Zoom Control |
|
|
329 | (3) |
|
|
332 | (1) |
|
Navigating to a Specific Location |
|
|
333 | (2) |
|
Getting the Location That Was Touched |
|
|
335 | (2) |
|
Geocoding and Reverse Geocoding |
|
|
337 | (3) |
|
|
340 | (8) |
|
|
348 | (1) |
|
|
348 | (3) |
Chapter 11 Networking |
|
351 | (30) |
|
Consuming Web Services Using HTTP |
|
|
352 | (18) |
|
|
354 | (7) |
|
|
361 | (3) |
|
Accessing Web Services Using the GET Method |
|
|
364 | (6) |
|
|
370 | (7) |
|
|
377 | (4) |
Chapter 12 Developing Android Services |
|
381 | (34) |
|
Creating Your Own Services |
|
|
382 | (15) |
|
Performing Long-Running Tasks in a Service |
|
|
386 | (5) |
|
Performing Repeated Tasks in a Service |
|
|
391 | (3) |
|
Executing Asynchronous Tasks on Separate Threads Using IntentService |
|
|
394 | (3) |
|
Establishing Communication Between a Service and an Activity |
|
|
397 | (4) |
|
Binding Activities to Services |
|
|
401 | (5) |
|
|
406 | (5) |
|
|
411 | (4) |
Appendix: Answers To Exercises |
|
415 | (6) |
Index |
|
421 | |