About the Author |
|
xv | |
About the Technical Reviewer |
|
xvii | |
Preface |
|
xix | |
|
Chapter 1 Android Platform |
|
|
1 | (14) |
|
|
1 | (9) |
|
|
3 | (3) |
|
|
6 | (1) |
|
|
7 | (2) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
10 | (3) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (2) |
|
Android Platform Fragmentation |
|
|
12 | (1) |
|
|
13 | (1) |
|
|
13 | (2) |
|
Chapter 2 Development Environment |
|
|
15 | (16) |
|
|
15 | (2) |
|
Android Software Development Kit |
|
|
15 | (1) |
|
Android Native Development Kit |
|
|
16 | (1) |
|
Android Development Tools for Eclipse |
|
|
16 | (1) |
|
|
16 | (1) |
|
Setting Up the Development Environment |
|
|
17 | (5) |
|
|
17 | (2) |
|
|
19 | (1) |
|
|
20 | (2) |
|
Hello Android Application |
|
|
22 | (7) |
|
Creating a New Android Application Project |
|
|
22 | (4) |
|
Building the Android Application |
|
|
26 | (1) |
|
Running the Android Application |
|
|
26 | (3) |
|
|
29 | (2) |
|
Chapter 3 Application Components |
|
|
31 | (38) |
|
|
31 | (5) |
|
|
32 | (1) |
|
|
32 | (1) |
|
|
33 | (3) |
|
|
36 | (5) |
|
|
37 | (1) |
|
|
37 | (1) |
|
Getting and Extracting the Intent |
|
|
38 | (1) |
|
|
39 | (2) |
|
|
41 | (15) |
|
|
41 | (1) |
|
|
42 | (1) |
|
Restricting Access to a Service |
|
|
42 | (2) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
Starting a Service with an Intent |
|
|
45 | (1) |
|
|
46 | (7) |
|
|
53 | (3) |
|
|
56 | (7) |
|
Creating a Content Provider |
|
|
56 | (3) |
|
Content Provider Contract |
|
|
59 | (1) |
|
Declaring a Content Provider |
|
|
59 | (1) |
|
Content Provider Security |
|
|
60 | (1) |
|
Accessing a Content Provider |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (3) |
|
Sending a Broadcast Message |
|
|
63 | (1) |
|
Receiving the Broadcast Message |
|
|
64 | (1) |
|
Broadcast Receiver Life Cycle |
|
|
65 | (1) |
|
Broadcast Receiver Security |
|
|
66 | (1) |
|
|
66 | (1) |
|
|
66 | (2) |
|
|
68 | (1) |
|
Chapter 4 Application Resources |
|
|
69 | (26) |
|
|
70 | (1) |
|
|
71 | (17) |
|
Property Animation Resources |
|
|
72 | (1) |
|
Tween Animation Resources |
|
|
73 | (1) |
|
Color State List Resources |
|
|
73 | (1) |
|
|
74 | (3) |
|
|
77 | (1) |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
79 | (8) |
|
|
87 | (1) |
|
Default and Alternative Resources |
|
|
88 | (3) |
|
Defining Alternative Resources |
|
|
88 | (1) |
|
Supported Configuration Qualifiers |
|
|
88 | (3) |
|
|
91 | (1) |
|
|
92 | (1) |
|
|
93 | (1) |
|
|
93 | (1) |
|
|
94 | (1) |
|
Chapter 5 Layouts and Views |
|
|
95 | (44) |
|
|
95 | (20) |
|
|
95 | (1) |
|
|
96 | (1) |
|
|
96 | (7) |
|
|
103 | (11) |
|
Loading the XML Layout Resource |
|
|
114 | (1) |
|
Accessing Individual Views in a Layout |
|
|
114 | (1) |
|
|
115 | (15) |
|
|
115 | (6) |
|
|
121 | (9) |
|
|
130 | (8) |
|
|
130 | (2) |
|
Adding a Fragment to an Activity |
|
|
132 | (2) |
|
|
134 | (1) |
|
Adding a User Interface to a Fragment |
|
|
135 | (1) |
|
Passing Arguments to a Fragment |
|
|
136 | (1) |
|
Communication Between the Activity and the Fragment |
|
|
137 | (1) |
|
|
138 | (1) |
|
|
139 | (32) |
|
|
139 | (9) |
|
|
140 | (1) |
|
|
141 | (1) |
|
Adding Actions to the Action Bar |
|
|
141 | (4) |
|
|
145 | (2) |
|
|
147 | (1) |
|
|
148 | (2) |
|
|
150 | (13) |
|
|
150 | (12) |
|
|
162 | (1) |
|
|
163 | (7) |
|
Accessing the Notification Service |
|
|
164 | (1) |
|
|
164 | (1) |
|
Adding Actions to a Notification |
|
|
165 | (2) |
|
Adding Action Buttons to a Notification |
|
|
167 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
|
171 | (28) |
|
|
171 | (9) |
|
|
171 | (2) |
|
|
173 | (4) |
|
Caching Data Using Storage |
|
|
177 | (1) |
|
Structuring Data Through JSON |
|
|
177 | (3) |
|
|
180 | (5) |
|
Opening Shared Preferences |
|
|
180 | (1) |
|
Adding and Editing Shared Preferences |
|
|
181 | (1) |
|
Reading the Shared Preferences |
|
|
181 | (1) |
|
Listening for Shared Preferences Changes |
|
|
182 | (1) |
|
|
183 | (2) |
|
SQLite Relational Database |
|
|
185 | (7) |
|
Creating and Opening the Database |
|
|
185 | (2) |
|
|
187 | (1) |
|
Upgrading the Existing Database |
|
|
187 | (1) |
|
|
188 | (2) |
|
Reading from the Database |
|
|
190 | (2) |
|
Deleting Data from the Database |
|
|
192 | (1) |
|
Deleting the Entire Database |
|
|
192 | (1) |
|
|
192 | (5) |
|
Signing Up for Android Backup Service |
|
|
193 | (1) |
|
Adding the Backup Service Key to the Manifest |
|
|
193 | (1) |
|
Providing the Backup Agent Implementation |
|
|
194 | (2) |
|
Declaring the Backup Agent in the Manifest |
|
|
196 | (1) |
|
|
196 | (1) |
|
Testing the Backup Agent Implementation |
|
|
196 | (1) |
|
|
197 | (2) |
|
Chapter 8 Sensors and Location |
|
|
199 | (18) |
|
|
199 | (10) |
|
|
199 | (3) |
|
|
202 | (4) |
|
Interpreting Sensor Events |
|
|
206 | (3) |
|
|
209 | (6) |
|
|
209 | (1) |
|
|
209 | (1) |
|
|
210 | (1) |
|
|
211 | (4) |
|
|
215 | (2) |
|
Chapter 9 Media and Camera |
|
|
217 | (32) |
|
|
217 | (6) |
|
|
217 | (2) |
|
|
219 | (4) |
|
|
223 | (7) |
|
|
223 | (2) |
|
|
225 | (1) |
|
|
226 | (4) |
|
|
230 | (3) |
|
Requesting Audio Record Permission |
|
|
230 | (1) |
|
Configuring the Audio Source for Recording |
|
|
230 | (1) |
|
Configuring the Audio Output for Recording |
|
|
231 | (1) |
|
Starting the Audio Recording |
|
|
232 | (1) |
|
Stopping the Audio Recording |
|
|
232 | (1) |
|
Releasing the MediaRecorder |
|
|
233 | (1) |
|
|
233 | (3) |
|
Creating a Surface for Video Playback |
|
|
233 | (1) |
|
|
234 | (1) |
|
|
235 | (1) |
|
|
236 | (1) |
|
Creating a Preview Surface for Video Recording |
|
|
236 | (1) |
|
Configuring the Video Source for Video Recording |
|
|
236 | (1) |
|
Configuring the Video Encoder for Video Recording |
|
|
237 | (1) |
|
|
237 | (10) |
|
Requesting the Camera Access Permission |
|
|
237 | (1) |
|
|
238 | (2) |
|
|
240 | (1) |
|
Capturing from the Camera |
|
|
241 | (6) |
|
|
247 | (2) |
Index |
|
249 | |