404 interapplication communication interapplication communication, 7 interfaces APIs. See APIs (<strong>Application</strong> Programming Interfaces) GTalk Service, 280–281 implementing AIDL, 356–361 user. See UIs (user interfaces) intermittent Activities, 29–30 Internet monitoring connectivity, 345–346 services, 361 Internet resources creating earthquake viewer, 153 introducing, 141–143 summary, 157 interprocess communication (IPC) support with AIDL, 356–361 uniqueness of Android, 11 Invitation Listener, 288 IPC (interprocess communication) support with AIDL, 356–361 uniqueness of Android, 11 iPhone, 3 ItemizedOverlays, 224, 239–240 J Java, 20 Java IDE (integrated development environment), 21 Java ME, 3 Java MIDlets, 2–3 JDK (Java <strong>Development</strong> Kit) downloading, 20 getting started, 19 K keyboardHidden, 65 keys interactive controls, 396–397 shortcut, 103 KML (Keyhole Markup Language), 209 L languages resources for different, 63–64 runtime confi guration changes, 64–65 latency, 32–33 lateral sensor changes, 325 latitude extracting, 215–216 geocoding, 220–223 MapController, 227 launch confi gurations, 25–26 Layout Managers, 79 layouts animating, 370–372 compound controls, 86 creating Activity, 66–67 creating Activity UIs, 77–78 creating UIs, 79–80 externalizing resources with, 52, 57 Map Views, 225–226 referencing resources, 61 using adapters, 136–141 using custom controls, 98–99 LBS (location-based Services ), 207–247 in Android, 6 creating map-based Activity, 224–226 fi nding location, 213–219 Geocoder, 220–223 ItemizedOverlays/OverlayItems, 239–240 Map Controller, 227–228 Map Views, 226–227 mapping earthquakes example, 242–247 mapping “Where Am I?”, 228–231 maps-based Activities, 224 My Location Overlay, 239 Overlays, 231–238 overview, 207–208 pinning Views to maps, 240–242 proximity alerts, 219–220 selecting Location Provider, 212–213 setting up Emulator with Test Providers, 208–211 summary, 247 LED (light-emitting diode) Notifi cations, 272 leverage, 143 libraries Android APIs, 15–16 Android media support, 8 GTalk Service, 280–281 software stack, 12–13 SQLite, 176 life-cycles Activities, 68–73 application, 50–51 light Notifi cations, 272 light sensors, 322 light theme, 373 light-emitting diode (LED) Notifi cations, 272 line drawing, 374 LinearLayout, 57, 79 Linkify class, 116–117 Linux Kernel security, 354 software stack, 12–13 Linux Phone Standards Forum (LiPS), 3 LiPS (Linux Phone Standards Forum), 3 ListActivity, 73 listeners adding to Compass View, 333 animation, 364–365 Animation, 371 Bluetooth, 343 Chat. See Chat Listeners click, 103, 127–128 creating Speedometer, 327 Location, 216–217 monitoring acceleration, 325 monitoring network connectivity, 346–347 OnKeyListener, 397 OnTouchListener, 396 orientation sensors, 330 phone state, 335–339 Sensor Manager, 321–322 SMS messages, 294–297 live video, 320 loading fi les, 174–175 Locale geocoding, 221–222 locale, 65 location runtime confi guration changes, 64–65 tracking cell, 336 Location Manager, 208 Location Providers defi ned, 208 managing Test, 209–211 selecting, 212–213 location-based Services (LBS). See LBS (location-based services ); LBS (location-based Services ) longitude extracting, 215–216 geocoding, 220–223 MapController, 227 sensor changes, 325 M magnetic fi eld sensor, 322 magnitude fi lter, 167, 172–173 Managers Activity, 35–36 Layout, 79 Location, 208 Notifi cation, 266 Sensor. See Sensor Manager Telephony, 334–339 Wi-Fi, 347–350 Window, 35–36 Manifest Editor, 49–50 Map Views confi guring and using, 226–227 defi ned, 224 Overlays. See Overlays MapActivity, 73, 224 MapController defi ned, 224 using, 227–228 maps based Activities, 224 creating Activity, 224–226 earthquakes example, 242–247 geocoding, 220–223 ItemizedOverlays/OverlayItems, 239–240 Map Controller, 227–228 Map Views, 226–227 My Location Overlay, 239 Overlays, 231–238 pinning Views to, 240–242 “Where Am I?”, 228–231
markers creating with Overlays, 239–240 pinning Views to maps, 240–242 MaskFilters, 377–378 Match Filter, 117 matching URIs, 195, 200 measuring Views, 90–92 media Android support, 8 APIs, 316–319 Media Player, 316–317 Media Store Content Provider defi ned, 193 recording media, 318 memory optimization and management, 8 speed and effi ciency, 35 MenuItemClickListener, 103 menus Activity, 101–104 adding preferences, 171 Android, 99–101 creating earthquake viewer, 153–154 dynamic updating and handling selections, 104 mapping earthquakes example, 243–244 populating with Intent Filters, 130–132 submenus and context menus, 105–107 to-do list example, 107–112 mesh drawing, 374 messaging instant. See IM (instant messaging) with Intents. See Intents P2P communication. See P2P (peer-to-peer) communication SMS. See SMS (short messaging service) Toasts, 262–264 metadata, 47–49 methods Activity lifetimes, 71–73 adding hyperlinks, 116–117 adding menus to to-do list example, 107–112 advanced development. See Android, advanced development background Services. See background Services broadcasting with Intents, 132–136 creating earthquake viewer, 148–156 creating new visual interface, 88–92 creating submenus and Context Menus, 105–107 data storage, retrieval and sharing. See data storage, retrieval and sharing defi ning Activity menus, 101–104 Dialog class, 144–147 hardware. See hardware APIs of location-based Services. See LBS (location-based Services ) modifying existing Views, 81–82 P2P communication. See P2P (peer-to-peer) communication returning results from Activities, 117–120 runtime confi guration changes, 65 understanding Hello World, 27–29 using resources in code, 60 MIDlets, 2–3 MIRROR, 377 MkSDCard, 42 mobile development, 4 mobile devices, 30–37 mobile phone handsets, 3 mobile phones, 1–2 mode values, 91 monitoring phone calls, 335–336 monitoring SMS messages, 294 movement, tracking. See tracking movement multimedia APIs, 316–319 Media Store Content Provider, 193 MyLocationOverlay, 224, 239 MyView, 67 N name/value pair (NVP) mechanism, 160 native actions Activity, 120–121 broadcast, 135–136 native applications of Android, 4–5 Internet resources, 141–143 uniqueness of Android, 11 native Content Providers, 192–194 native Internet resources, 142 native link types, 116 navigation confi guration changes, 65 menu, 99–101 nested submenus, 105 network connections. See also connectivity Internet resources, 142–143 managing, 345–350 mobile device limitations, 32–33 Network Providers, 212 networks, phone, 338 Nine Patches, 381 NinePatch (stretchable PNG) images, 56 Notifi cation Manager, 266 notifi cations background Services, 265–273 defi ned, 7, 46 Sensor Manager, 322 NVP (name/value pair) mechanism, 160 O objects binding Views to arrays, 136–141 creating static, 381 Parcels Cursors and Content Values, 176–177 drawing, 374 passing custom class, 356–358 off the hook phones, 336 OHA (Open Handset Alliance), 8–9 OMA (Open Mobile Alliance), 3 ongoing Notifi cations, 272–273 OnKeyListener, 397 online support, 12 OnTouchListener, 396 opacity, 375 Open Handset Alliance (OHA), 8–9 Open Mobile Alliance (OMA), 3 open platforms, 4 opening databases, 179–180 opening socket connections, 342–343 orientation, 65 orientation sensors accelerometers and compasses, 323 adding to Compass View, 330–332 constants, 322 defi ned, 329–330 OTA (over the air), 289 outgoing phone calls, 335–336 output sources, 318 oval drawing, 374 over the air (OTA), 289 OverlayItems, 224, 239–240 Overlays bringing to life, 389–390 defi ned, 231–238 ItemizedOverlays/OverlayItems, 239–240 map, 224 mapping earthquakes example, 246 My Location Overlay, 239 P P2P (peer-to-peer) communication, 279–314 automating SMS Emergency Responder, 306–314 binding to GTalk Service, 281–282 Chat Sessions, 286–289 GTalk Connections, 282–286 GTalk Service, 280–281 instant messaging, 280 overview, 279 sending and receiving data messages, 289–291 Services, 7–8, 11 SMS, 291–297 SMS Emergency Responder example, 297–306 summary, 314 Paint, 373 painting Canvas drawing, 374–379 improving quality with anti-aliasing, 379–380 pairing Bluetooth devices, 341–342 panning, 227–228 Parcels, 356–358 405
- Page 1 and 2:
Professional Android Application su
- Page 3:
Professional Android Application D
- Page 6 and 7:
Professional Android Application D
- Page 8 and 9:
About the Author Originally from Pe
- Page 10 and 11:
Acknowledgments A big thank you goe
- Page 12 and 13:
Contents Chapter 2: Getting Started
- Page 14 and 15:
Contents xii Saving and Loading Fil
- Page 16 and 17:
Contents Chapter 10: Accessing Andr
- Page 19 and 20:
Introduction Now is an exciting tim
- Page 21 and 22:
Introduction covered, you can move
- Page 23:
Introduction At http://p2p.wrox.com
- Page 26 and 27:
Chapter 1: Hello, Android 2 Using t
- Page 28 and 29:
Chapter 1: Hello, Android An Open P
- Page 30 and 31:
Chapter 1: Hello, Android 6 ❑ ❑
- Page 32 and 33:
Chapter 1: Hello, Android 8 When ma
- Page 34 and 35:
Chapter 1: Hello, Android 10 In mar
- Page 36 and 37:
Chapter 1: Hello, Android 12 Each A
- Page 38 and 39:
Chapter 1: Hello, Android 14 ❑ Da
- Page 40 and 41:
Chapter 1: Hello, Android 16 ❑ an
- Page 43 and 44:
Getting Started All you need to sta
- Page 45 and 46:
Chapter 2: Getting Started Unless o
- Page 47 and 48:
Installing the ADT Plug-in Install
- Page 49 and 50:
Chapter 2: Getting Started 3. In th
- Page 51 and 52:
Chapter 2: Getting Started If every
- Page 53 and 54:
} lp = new LinearLayout.LayoutParam
- Page 55 and 56:
❑ ❑ ❑ ❑ ❑ Small screens w
- Page 57 and 58:
Chapter 2: Getting Started on how t
- Page 59 and 60:
Chapter 2: Getting Started To start
- Page 61 and 62:
Ensuring a Seamless User Experience
- Page 63 and 64:
Figure 2-11 Chapter 2: Getting Star
- Page 65 and 66:
} myListView.setAdapter(aa); Chapte
- Page 67 and 68:
Chapter 2: Getting Started A number
- Page 69 and 70:
Creating Applications and Activitie
- Page 71 and 72:
Chapter 3: Creating Applications an
- Page 73 and 74:
Chapter 3: Creating Applications an
- Page 75 and 76:
Chapter 3: Creating Applications an
- Page 77 and 78:
Creating Resources Chapter 3: Creat
- Page 79 and 80:
❑ ❑ #ARGB #ARRGGBB Chapter 3: C
- Page 81 and 82:
Chapter 3: Creating Applications an
- Page 83 and 84:
android:startOffset=”500” andro
- Page 85 and 86:
Referencing Resources in Resources
- Page 87 and 88:
Chapter 3: Creating Applications an
- Page 89 and 90:
Chapter 3: Creating Applications an
- Page 91 and 92:
Chapter 3: Creating Applications an
- Page 93 and 94:
Chapter 3: Creating Applications an
- Page 95 and 96:
} } Chapter 3: Creating Application
- Page 97:
Chapter 3: Creating Applications an
- Page 100 and 101:
Chapter 4: Creating User Interfaces
- Page 102 and 103:
Chapter 4: Creating User Interfaces
- Page 104 and 105:
Chapter 4: Creating User Interfaces
- Page 106 and 107:
Chapter 4: Creating User Interfaces
- Page 108 and 109:
Chapter 4: Creating User Interfaces
- Page 110 and 111:
Chapter 4: Creating User Interfaces
- Page 112 and 113:
Chapter 4: Creating User Interfaces
- Page 114 and 115:
Chapter 4: Creating User Interfaces
- Page 116 and 117:
Chapter 4: Creating User Interfaces
- Page 118 and 119:
Chapter 4: Creating User Interfaces
- Page 120 and 121:
Chapter 4: Creating User Interfaces
- Page 122 and 123:
Chapter 4: Creating User Interfaces
- Page 124 and 125:
Chapter 4: Creating User Interfaces
- Page 126 and 127:
Chapter 4: Creating User Interfaces
- Page 128 and 129:
Chapter 4: Creating User Interfaces
- Page 130 and 131:
Chapter 4: Creating User Interfaces
- Page 132 and 133:
Chapter 4: Creating User Interfaces
- Page 134 and 135:
Chapter 4: Creating User Interfaces
- Page 136 and 137:
Chapter 4: Creating User Interfaces
- Page 138 and 139:
Chapter 5: Intents, Broadcast Recei
- Page 140 and 141:
Chapter 5: Intents, Broadcast Recei
- Page 142 and 143:
Chapter 5: Intents, Broadcast Recei
- Page 144 and 145:
Chapter 5: Intents, Broadcast Recei
- Page 146 and 147:
Chapter 5: Intents, Broadcast Recei
- Page 148 and 149:
Chapter 5: Intents, Broadcast Recei
- Page 150 and 151:
Chapter 5: Intents, Broadcast Recei
- Page 152 and 153:
Chapter 5: Intents, Broadcast Recei
- Page 154 and 155:
Chapter 5: Intents, Broadcast Recei
- Page 156 and 157:
Chapter 5: Intents, Broadcast Recei
- Page 158 and 159:
Chapter 5: Intents, Broadcast Recei
- Page 160 and 161:
Chapter 5: Intents, Broadcast Recei
- Page 162 and 163:
Chapter 5: Intents, Broadcast Recei
- Page 164 and 165:
Chapter 5: Intents, Broadcast Recei
- Page 166 and 167:
Chapter 5: Intents, Broadcast Recei
- Page 168 and 169:
Chapter 5: Intents, Broadcast Recei
- Page 170 and 171:
Chapter 5: Intents, Broadcast Recei
- Page 172 and 173:
Chapter 5: Intents, Broadcast Recei
- Page 174 and 175:
Chapter 5: Intents, Broadcast Recei
- Page 176 and 177:
Chapter 5: Intents, Broadcast Recei
- Page 178 and 179:
Chapter 5: Intents, Broadcast Recei
- Page 180 and 181:
Chapter 5: Intents, Broadcast Recei
- Page 183 and 184:
Data Storage, Retrieval, and Sharin
- Page 185 and 186:
Chapter 6: Data Storage, Retrieval,
- Page 187 and 188:
Chapter 6: Data Storage, Retrieval,
- Page 189 and 190:
Chapter 6: Data Storage, Retrieval,
- Page 191 and 192:
Chapter 6: Data Storage, Retrieval,
- Page 193 and 194:
} Chapter 6: Data Storage, Retrieva
- Page 195 and 196:
Chapter 6: Data Storage, Retrieval,
- Page 197 and 198:
} Chapter 6: Data Storage, Retrieva
- Page 199 and 200:
Chapter 6: Data Storage, Retrieval,
- Page 201 and 202:
Chapter 6: Data Storage, Retrieval,
- Page 203 and 204:
} } } Chapter 6: Data Storage, Retr
- Page 205 and 206:
Querying Your Database Chapter 6: D
- Page 207 and 208:
Chapter 6: Data Storage, Retrieval,
- Page 209 and 210:
Chapter 6: Data Storage, Retrieval,
- Page 211 and 212:
} // Open or create the database to
- Page 213 and 214:
} Chapter 6: Data Storage, Retrieva
- Page 215 and 216:
Adding, Updating, and Deleting Cont
- Page 217 and 218:
Chapter 6: Data Storage, Retrieval,
- Page 219 and 220:
Chapter 6: Data Storage, Retrieval,
- Page 221 and 222:
} } Chapter 6: Data Storage, Retrie
- Page 223 and 224:
Chapter 6: Data Storage, Retrieval,
- Page 225 and 226:
} Chapter 6: Data Storage, Retrieva
- Page 227 and 228:
} } break; Chapter 6: Data Storage,
- Page 229 and 230:
Chapter 6: Data Storage, Retrieval,
- Page 231 and 232:
Maps, Geocoding, and Location-Based
- Page 233 and 234:
Chapter 7: Maps, Geocoding, and Loc
- Page 235 and 236:
} Chapter 7: Maps, Geocoding, and L
- Page 237 and 238:
Chapter 7: Maps, Geocoding, and Loc
- Page 239 and 240:
Chapter 7: Maps, Geocoding, and Loc
- Page 241 and 242:
} Chapter 7: Maps, Geocoding, and L
- Page 243 and 244:
} Chapter 7: Maps, Geocoding, and L
- Page 245 and 246:
Chapter 7: Maps, Geocoding, and Loc
- Page 247 and 248:
Chapter 7: Maps, Geocoding, and Loc
- Page 249 and 250:
Chapter 7: Maps, Geocoding, and Loc
- Page 251 and 252:
Chapter 7: Maps, Geocoding, and Loc
- Page 253 and 254:
Chapter 7: Maps, Geocoding, and Loc
- Page 255 and 256:
} Chapter 7: Maps, Geocoding, and L
- Page 257 and 258:
Chapter 7: Maps, Geocoding, and Loc
- Page 259 and 260:
Chapter 7: Maps, Geocoding, and Loc
- Page 261 and 262:
} Chapter 7: Maps, Geocoding, and L
- Page 263 and 264:
Chapter 7: Maps, Geocoding, and Loc
- Page 265 and 266:
Chapter 7: Maps, Geocoding, and Loc
- Page 267 and 268:
Chapter 7: Maps, Geocoding, and Loc
- Page 269 and 270:
} Chapter 7: Maps, Geocoding, and L
- Page 271:
Summary Chapter 7: Maps, Geocoding,
- Page 274 and 275:
Chapter 8: Working in the Backgroun
- Page 276 and 277:
Chapter 8: Working in the Backgroun
- Page 278 and 279:
Chapter 8: Working in the Backgroun
- Page 280 and 281:
Chapter 8: Working in the Backgroun
- Page 282 and 283:
Chapter 8: Working in the Backgroun
- Page 284 and 285:
Chapter 8: Working in the Backgroun
- Page 286 and 287:
Chapter 8: Working in the Backgroun
- Page 288 and 289:
Chapter 8: Working in the Backgroun
- Page 290 and 291:
Chapter 8: Working in the Backgroun
- Page 292 and 293:
Chapter 8: Working in the Backgroun
- Page 294 and 295:
Chapter 8: Working in the Backgroun
- Page 296 and 297:
Chapter 8: Working in the Backgroun
- Page 298 and 299:
Chapter 8: Working in the Backgroun
- Page 300 and 301:
Chapter 8: Working in the Backgroun
- Page 303 and 304:
Peer-to-Peer Communication In this
- Page 305 and 306:
Chapter 9: Peer-to-Peer Communicati
- Page 307 and 308:
} Chapter 9: Peer-to-Peer Communica
- Page 309 and 310:
Handling Subscription Requests Chap
- Page 311 and 312:
Chapter 9: Peer-to-Peer Communicati
- Page 313 and 314:
} Chapter 9: Peer-to-Peer Communica
- Page 315 and 316:
Chapter 9: Peer-to-Peer Communicati
- Page 317 and 318:
Chapter 9: Peer-to-Peer Communicati
- Page 319 and 320:
Chapter 9: Peer-to-Peer Communicati
- Page 321 and 322:
Chapter 9: Peer-to-Peer Communicati
- Page 323 and 324:
Chapter 9: Peer-to-Peer Communicati
- Page 325 and 326:
} Chapter 9: Peer-to-Peer Communica
- Page 327 and 328:
Figure 9-4 Chapter 9: Peer-to-Peer
- Page 329 and 330:
Chapter 9: Peer-to-Peer Communicati
- Page 331 and 332:
Chapter 9: Peer-to-Peer Communicati
- Page 333 and 334:
Chapter 9: Peer-to-Peer Communicati
- Page 335 and 336:
} Chapter 9: Peer-to-Peer Communica
- Page 337 and 338:
Chapter 9: Peer-to-Peer Communicati
- Page 339 and 340:
Accessing Android Hardware Android
- Page 341 and 342:
Chapter 10: Accessing Android Hardw
- Page 343 and 344:
content.put(Audio.AudioColumns.DATE
- Page 345 and 346:
public void onShutter() { // TODO D
- Page 347 and 348:
Chapter 10: Accessing Android Hardw
- Page 349 and 350:
Chapter 10: Accessing Android Hardw
- Page 351 and 352:
Chapter 10: Accessing Android Hardw
- Page 353 and 354:
Chapter 10: Accessing Android Hardw
- Page 355 and 356:
public void setPitch(float pitch) {
- Page 357 and 358:
} setContentView(R.layout.main); Ch
- Page 359 and 360:
Chapter 10: Accessing Android Hardw
- Page 361 and 362:
Chapter 10: Accessing Android Hardw
- Page 363 and 364:
Chapter 10: Accessing Android Hardw
- Page 365 and 366:
Chapter 10: Accessing Android Hardw
- Page 367 and 368:
Chapter 10: Accessing Android Hardw
- Page 369 and 370:
Chapter 10: Accessing Android Hardw
- Page 371 and 372:
Chapter 10: Accessing Android Hardw
- Page 373 and 374:
Chapter 10: Accessing Android Hardw
- Page 375:
Chapter 10: Accessing Android Hardw
- Page 378 and 379: Chapter 11: Advanced Android Develo
- Page 380 and 381: Chapter 11: Advanced Android Develo
- Page 382 and 383: Chapter 11: Advanced Android Develo
- Page 384 and 385: Chapter 11: Advanced Android Develo
- Page 386 and 387: Chapter 11: Advanced Android Develo
- Page 388 and 389: Chapter 11: Advanced Android Develo
- Page 390 and 391: Chapter 11: Advanced Android Develo
- Page 392 and 393: Chapter 11: Advanced Android Develo
- Page 394 and 395: Chapter 11: Advanced Android Develo
- Page 396 and 397: Chapter 11: Advanced Android Develo
- Page 398 and 399: Chapter 11: Advanced Android Develo
- Page 400 and 401: Chapter 11: Advanced Android Develo
- Page 402 and 403: Chapter 11: Advanced Android Develo
- Page 404 and 405: Chapter 11: Advanced Android Develo
- Page 406 and 407: Chapter 11: Advanced Android Develo
- Page 408 and 409: Chapter 11: Advanced Android Develo
- Page 410 and 411: Chapter 11: Advanced Android Develo
- Page 412 and 413: Chapter 11: Advanced Android Develo
- Page 414 and 415: Chapter 11: Advanced Android Develo
- Page 416 and 417: Chapter 11: Advanced Android Develo
- Page 418 and 419: Chapter 11: Advanced Android Develo
- Page 420 and 421: Chapter 11: Advanced Android Develo
- Page 422 and 423: Chapter 11: Advanced Android Develo
- Page 424 and 425: 400 Android, getting started Androi
- Page 426 and 427: 402 databases databases creating ea
- Page 430 and 431: 406 passing custom class objects pa
- Page 432 and 433: 408 synchronizing threads synchroni
- Page 435 and 436: Programmer to Programmer Get more