3D objects, drawing, 325
coloring vertices, 326
accessibility features, 150-151
accessing
Internet, 170
handling network operations asynchronously, 174-179
parsing XML from the network, 172-174
reading data from the web, 170-171
retrieving Android network status, 179-180
secondary logs, LogCat, 455
accessories, USB, 268
Accessory Development Kit (ADK), 149-150
synchronizing data with sync adapters, 406-407
accounts
creating Google accounts for analytics, 429-430
managing with Account Manager, 405-406
acquiring references to sensors, 256
acting as content type handlers, 381-382
advanced features, 114
application icon clicks, 112-113
contextual action mode, 114
creating basic action bars, 106-109
screens that do not require action bars, 114
action tag, 384
ActionScript 3, 196
Activity class, 108
implementing to process intents, 383
activity tag, 384
ad and market referrals, tracking, 438
ADB (Android Debug Bridge), 447
bug reports, 456
copying files, 450
directing commands to specific devices, 448
installing applications, 451
installing custom binaries via the shell, 459-461
listing connected devices and emulators, 447
LogCat, 452
accessing secondary logs, 455
displaying log information, 452
filtering log information, 453-454
including date and time with log data, 452
redirecting log output to files, 454
reinstalling applications, 451
retrieving files from devices or emulators, 450
sending files to devices or emulators, 450
shell commands, issuing, 449-450
starting ADB server process, 448
stopping ADB server process, 448
uninstalling applications, 452
using shell to inspect SQLite databases, 456
using shell to stress test applications, 456-458
ADB commands, listing, 448
ADB server process, 448
ADB shell, sqlite3, 464
addGlobalFocusChangeListener() method, 129
addGlobalLayoutListener() method, 129
addHelper() method, 409
adding
browser chrome with WebChromeClient, 188-189
features to WebView, 186
libraries to Eclipse projects, 431
addJavascriptInterface() method, 194
addOnTouchModeChangeListener() method, 27
ADK (Accessory Development Kit), 149-150
advanced action bar features, action bars, 114
AIDL files, 25
AIR apps, building for Android, 196
altering data in tables, SQLite, 473
alternative resources
changing language settings, 418-420
leveraging, 161
alternatives to C2DM, 403
Amazon Appstore in-app billing APIs, leveraging, 426
Amazon Kindle Fire, developing applications for, 166
analytics, creating Google accounts for, 429-430
Android, extending web application functionality to, 190-195
Android Application server side, integrating C2DM services, 402-403
Android applications, developing for Google TV, 165-166
Android Backup Service, registering with, 408
Android Beam, 269
configuring manifest files, 272
Android client side, integrating C2DM services, 402
Android Debug Bridge. See ADB
Android Lint Tool, 151
Android manifest file, configuring for sensors, 255
Android manifest files, configuring
for live wallpaper, 379
Android Market campaign tracking, 438
Android Market in-app billing APIs, leveraging, 425-426
Android NDK (Native Development Kit), 355
calling native code from Java, 358-359
exceptions with native code, 360-362
native activities, 362
parameters and return values, 359-360
exploring, 357
improving graphics performance, 362-363
installing, 356
running sample applications, 357
versus RenderScript, 363
Android network status, retrieving, 179-180
Android SDK, OpenGL ES APIs, 317
Android Software Development Kit (SDK), 17
android.speech.RecognizerIntent, 152
animation, 301
frame-by-frame animation, 302-303
property animation, 309
defining programmatically, 311
starting programmatically, 312
loading, 306
moving transformations, 308
programmatically, 305
rotating transformations, 307
scaling transformations, 308
transparency transformations, 307
as XML resources, 304
ANR (Application Not Responding) events, 9
anti-aliasing, Paint, 281
API Level 11, execute() method, 12
APIs
OpenGL ES, 317
becoming hosts, 375
configuring Android manifest files, 373-374
creating, 367
determining whether configuration activities are required, 369
providers, 369
updating, 372
application broadcasts, securing, 80
application context, SQLite database instances
creating, 36
deleting, 47
application database files, finding on device file systems, 36
application icon clicks, action bars, 112-113
application lifecycle, cursors, 42
application manifest files, registering backup agents, 412
Application Not Responding events, 9
application threads
OpenGL threads talking to application threads, 333-334
talking to OpenGL threads, 335-337
applications
ADB
installing, 451
reinstalling, 451
uninstalling, 452
collecting data from, Google Analytics SDK, 432
configuring for OpenGL ES 2.0, 341
developing for Amazon Kindle Fire, 166
developing for Google TV, 164-165
developing for tables, 162-163
internationalizing, 415
alternative resources, 416-417
changing language settings, 418-420
implementing locale support programmatically, 421
publishing for foreign users, 422
AppWidgetProvider class, 369
archived data, wiping (ADB), 456
asynchronous processing, importance of, 9-10
AsyncTask class, 10-12, 174-175
attracting users, device diversity, 161
audio, 233
playing, 235
sharing, 236
AudioManager, 235
AUTOINCREMENT, creating tables, 470
backup agents
implementing, 409
backup helpers for files, 410-412
backup helpers for shared preferences, 409
providing backup agent implementation, 409
registering in application manifest files, 412
backup helpers for files, implementing, 410-412
backup helpers for shared preferences, implementing, 409
backup operations, forcing ADB, 455
backup services, 407
ADB, 455
forcing backup operations, 455
forcing restore operations, 456
wiping archived data, 456
backup and restoring application data, 412
requesting backups, 412
requesting restores, 413
implementing backup agents, 409
backup helpers for files, 410-412
backup helpers for shared preferences, 409
providing backup agent implementation, 409
registering backup agents in application manifest files, 412
remote backup services, 408
registering with Android Backup Service, 408
BackupManager, 412
backups, requesting, 412
basic broadcasts, sending, 74
basic searches, enabling, 387
batteries, monitoring, 258-260
BatteryManager object, 260
BATTERY_STATS permission, 259
to application user interfaces, 50-51
with data adapters, 51
with simpleCursorAdapter, 51-54
bitmaps, 287
drawing on Canvas, 287
scaling graphics, 287
transforming with matrixes, 287-288
blinking lights, notifications, 92-93
blocking operations, 9
checking for existence of, 264
discovering devices, 265
enabling, 264
establishing connections, 266
querying for paired devices, 265
BluetoothAdapter class, 264
BluetoothDevice class, 264
BluetoothServerSocket class, 264
BluetoothSocket class, 264
BroadcastReceiver object, 31
broadcasts
ordered broadcasts, 73
receiving, 75
handling incoming broadcasts, 77-79
registering to receive, 76
registering to receive dynamically, 76-77
registering to receive statically, 77
securing application broadcasts, 80
Browser application, 183
browser chrome, adding with WebChromeClient, 188-189
browsing
WebKit APIs, 190
bug reports, ADB, 456
C2DM (Cloud to Device Messaging), 399
alternatives to, 403
integrating
on Android Application server side, 402-403
on Android client side, 402
message flow, 400
overview, 399
sample applications, 403
signing up for, 401
calculated columns, SQLite, 474-476
subqueries, 476
calibrating sensors, 258
call state, requesting, 240-242
callbacks, 22
CallVoidMethod(), 361
Camera class, 225
cameras, 220
assigning images as wallpaper, 227-228
capturing still images, 220-225
choosing from device cameras, 228-229
face detection, 233
mode settings, 225
parameters, 225
video, 229
playing, 231
zooming, 226
cancelDiscovery() method, 265
drawing bitmaps, 287
linear gradients, 282
radical gradients, 283
sweep gradients, 283
capture() method, 224
capturing still images with cameras, 220-225
choosing from device cameras, 228-229
Chrome to Phone app, 403
classes
Activity, 108
AppWidgetProvider, 369
BluetoothAdapter, 264
BluetoothDevice, 264
BluetoothServerSocket, 264
BluetoothSocket, 264
Camera, 225
ContextMenu, 103
Cursor, 41
CursorAdapter, 69
GeomagneticField, 258
GestureListener, 140
GLSurfaceView.Renderer class, 317
GpsSatellite, 216
ItemizedOverlay, 215
JavaScriptExtensions, 192
Loader, 14
Matrix, 287
PrefListenerService, 372
RSSurfaceView, 350
ScrubActivity, 112
SensorManager, 255
Shape, 289
ShapeDrawable, 289
SimpleDataUpdateService, 372
SQLiteDatabase
deleting records, 39
inserting records, 38
updating records, 39
UsbManager, 268
ViewTreeObserver, 128
WebChromeClient, 192
cleaning up OpenGL ES, 337
clearing
logs (LogCat), 454
notifications, 90
clicks, listening for long clicks, 129-130
clipboard, 126
copying data to system clipboard, 127
pasting data to system clipboard, 127
close() method, 47
closing SQLite databases, 47
Cloud to Device Messaging. See C2DM
collecting data from applications, Google Analytics SDK, 432
color, Paint, 281
coloring vertices, 326
commands, ADB commands
directing to specific devices, 448
listing, 448
compatibility
notifications, 84
complex objects, drawing, 327-328
composite primary keys, SQLite, 472
configurations, App Widgets, 367-368
configuring
Android manifest file for sensors, 255
Android manifest files
for live wallpaper, 379
applications for OpenGL ES 2.0, 341
ProGuard for your apps, 443-444
SQLite database properties, 37
connected devices and emulators, listing in ADB, 447
connecting to SQLite databases, sqlite3, 464
connections, establishing between devices (Bluetooth), 266
content
locating with URIs, 67
content providers, 57
accessing images on devices, 66-67
data columns, 59
data URIs, 59
data-binding to gallery control, 69-70
enhancing applications, 65
implementing interfaces, 58
implementing methods, 59
locating content using URIs, 67
retrieving data with CursorLoader, 68-69
retrieving gallery images and saving to databases, 71
updating manifest files, 65
content type handlers, acting as, 381-382
Context.getSystemService() method, 269
Context.startService() method, 18
ContextMenu class, 103
contextual action mode, 114
controlling
hardware acceleration, 298
copying
data to system clipboard, 127
files, ADB, 450
createBitmap() method, 287
createScript() method, 350
Cursor class, 41
Cursor objects, 42
CursorAdapter class, extending, 69
CursorLoader, retrieving content provider data, 68-69
cursors, SQLite databases, 41-42
custom binaries, installing via shell (ADB), 459-461
custom view control, rendering to, 350-352
customizing
Dalvik Debug Monitor Service (DDMS), 241
data, 50
binding
to application user interfaces, 50-51
with data adapters, 51
with SimpleCursorAdapter, 51-54
collecting from applications, Google Analytics SDK, 432
copying to system clipboard, 127
extracting in SQLite databases, 42-43
pasting to system clipboard, 127
synchronizing with sync adapters, 406-407
data adapters, binding data, 51
data binding to gallery control, 69-70
data columns, defining, 59
data connection speed, monitoring, 243
data URIs, defining, 59
persistent databases, designing, 47-48
SQLite, importing/exporting, 466-468
dataChanged() method, 412
DDMS (Dalvik Debug Monitor Service), 241
delete() method, content providers, 63-64
deleteDatabase() method, 47
deleting
records, SQLiteDatabase class, 39
SQLite database instances with application context, 47
SQLite databases, tables and objects, 47
tables, SQLite, 476
designing
flexible user interfaces, 160
layouts with WebView, 184
notifications, 96
persistent databases, 47
field names, 48
student grade database example, 470
destroyRenderScriptGL() method, 351
detecting user motions within a view, 131-132
developing
Android applications for Google TV, 165-166
applications
for Amazon Kindle Fire, developing apps for, 166
device, determining location of, 198-200
device cameras, choosing from, 228-229
device compatibility, OpenGL, 316-317
alternative resources, 161
attracting new types of users, 161
designing flexible user interfaces, 160
device file system, finding application database files, 36
device orientation, determining, 258
acquiring references to, 256
calibrating, 258
configuring Android manifest file for sensors, 255
determining orientation, 258
finding true north, 258
devices
ADB, 450
discovering, 265
dictionaries, user dictionaries, 126
directing ADB commands to specific devices, 448
discovering devices, Bluetooth, 265
dispatch() method, 432
displaying
images from network resources, 177-179
log information, LogCat, 452
divideMessages() method, 248
doAlert() function, 193
doBackup() method, 412
doConsoleLog() function, 193
doInBackground() method, 11
doRestore() methods, 412
doServiceStart() method, 21
doSetFormText() function, 193
doToast() function, 193
double-tap gesture, 133
drag and drop framework, gestures, 143
Drawable, 215
drawing
3D objects, 325
coloring vertices, 326
shapes, 291
rectangles and squares, 291
rectangles with rounded corners, 291-293
drawing on the screen, 279
linear gradients, 282
radical gradients, 283
sweep gradients, 283
easy OpenGL ES, GLSurfaceView, 337-340
Eclipse, AIDL files, 25
Eclipse projects, adding libraries to, 431
eCommece, Google Analytics SDK, 436
reviewing reports, 437
EGLConfig object, 340
eglDestroyContext(), 337
eglDestroySurface(), 337
eglMakeCurrent(), 337
emulators
ADB, 450
locating, 200
enhancing applications, 365-366
error reports, ProGuard, 444
events
eCommerce events, logging, 436-437
handling WebView events with WebViewClient, 186-187
logging Google Analytics SDK, 432
user events. See user events
ExceptionOccurred(), 361
exceptions with native code, Android NDK, 360-362
execSQL() method, 37
execute() method, AsyncTask class, 11
executing
commands on command line, SQLite, 468
queries, 44
raw queries, 46
SQLiteQueryBuilder, 45
exporting databases, SQLite, 466-468
extending web application functionality to Android, 190-195
extracting data, SQLite databases, 42-43
face detection, 233
features, adding to WebView, 186
field names, databases, 48
files
copying in ADB, 450
retrieving from devices or emulators, 450
sending to devices or emulators, 450
filtering log information, LogCat, 453-454
finding application database files on device file system, 36
finding true north, sensors, 258
fine-tuning hardware acceleration, 298
Flash, 195
building AIR apps for Android, 196
enabling applications, 195
fling gesture, 133
focus changes, listening for, 130-131
foreign keys, SQLite, 472
foreign users, publishing applications for, 422
formatNumber() method, 243
frame-by-frame animation, 302-303
Galaxy Nexus Android device, 255
gallery control, data binding to, 69-70
game design, 162
GeomagneticField class, 258
GestureDetector class, 132-133
GestureListener class, 140
GestureOverlayView, 132
gestures, 131
detecting user motions within a view, 131-132
drag and drop framework, 143
making them natural, 142
single-touch gestures, 132-138
getAccessoryList() method, 268
getAddressLine() method, 202
getAvailableLocales() method, 421
getBestProvider() method, 199
getCenter() method, 216
getDefault() method, 421
getDuration(), 232
getFeatureName() method, 202
getLocality() method, 202
getRoaming() method, 242
getSystemService() method, 240
getTextBounds method, 287
getType() method, content providers, 64-65
GL (Graphics Library), 315
initializing, 323
glCompileShader(), 344
GLDebugHelper, 323
glDrawArrays(), 325
glDrawElements(), 325
global positioning services. See GPS
global search
enabling, 395
updating search configurations, 396
updating search settings, 397
glShaderSource() method, 344
GLSurfaceView, 317
GLSurfaceView (easy OpenGL ES), 337-340
GLSurfaceView.Render class, 317
glUseProgram() method, 344
Google Analytics, creating Google accounts for, 429-430
Google Analytics Dashboard, 433-435
Google Analytics SDK
adding the library to your Eclipse project, 431
collecting data from applications, 432
eCommerce, 436
reviewing reports, 437
logging different events, 432
protecting users’ privacy, 439
tracking ad and market referrals, 438
Google APIs, 201
Google TV
developing Android applications for, 165-166
developing applications for, 164-165
optimizing web applications for, 165
GPS (global positioning services), 197-198
determining location of device, 198-200
locating your emulator, 200
GpsSatellite class, 216
GPXPoint class, 27
gradients, Paint, 281
graphics
bitmap graphics, scaling, 287
improving performance (Android NDK), 362-363
guidelines, user interfaces, 99
hardware
Android Beam, 269
configuring manifest files, 272
checking for existence of, 264
discovering devices, 265
enabling, 264
establishing connections, 266
querying for paired devices, 265
acquiring reference to, 256
calibrating, 258
configuring Android manifest file, 255
determining device orientation, 258
finding true north, 258
USB, 267
accessories, 268
hosts, 269
Wi-Fi, 273
Wi-Fi Direct, 273
hardware acceleration, 297
controlling, 298
fine-tuning, 298
hosts
App Widgets, 375
USB, 269
HTTP, 170
reading data from the web, 170-171
icons, text notifications, 85-86
images
assigning as wallpaper, 227-228
displaying from network resources, 177-179
retrieving, 71
saving to databases, 71
IME (Input Method Editors), 123
implementing
backup agents, 409
backup helpers for files, 410-412
backup helpers for shared preferences, 409
providing backup agent implementation, 409
registering backup agents in application manifest files, 412
content provider interfaces, 58
content provider methods, 59
importing databases, SQLite, 466-468
improving graphics performance, Android NDK, 362-363
leveraging
Amazon Appstore in-app billing APIs, 426
Android Market in-app billing APIs, 425-426
in-app billing APIs, 427
PayPal in-app billing APIs, 426
incoming broadcasts, handling, 77-79
GL, OpenGL ES, 323
Input Method Editors (IME), 123
insert() method, content providers, 61-62
inserting
data into tables, SQLite, 471
records, SQLiteDatabase class, 38
installing
Android NDK, 356
applications, ADB, 451
custom binaries via shell, ADB, 459-461
live wallpaper, 379
instances
SQLite database instances, creating with application context, 36
SQLite databases, deleting with application context, 47
Integrated Raster Imaging System Graphics Library (IRIS GL), 315
integrating C2DM services
on Android application server side, 402-403
on Android client side, 402
intent actions, 382
Intent extras, 31
intent filter, registering, 384
IntentFilter, 32
intents
implementing Activity to process, 383
mapping, 205
interacting with hardware, 253-254
interfaces
content provider interfaces, implementing, 58
designing flexible user interfaces, 160
internationalizing applications, 415
alternative resources, 416-420
implementing locale support programmatically, 421
Internet, accessing, 170
handling network operations asynchronously, 174-179
parsing XML from the network, 172-174
reading data from the web, 170-171
retrieving Android network status, 179-180
invalidate() method, 140
IRIS GL (Integrated Raster Imaging System Graphics Library), 315
isDiscovering() method, 265
issuing shell commands, 449-450
ItemizedOverlay class, 215
iterating rows of query results, SQLite databases, 42-43
Java, calling native code (Android NDK), 358-359
JavaScriptExtensions class, 192
JNIenvironment object, 360
JOIN, querying multiple tables (SQLite), 474
Khronos Group, 315
Kindle Fire, 161
layouts, designing with WebView, 184
LBS (location-based services), 197, 216
GPS (global positioning services), 197-198
determining location of device, 198-200
locating your emulator, 200
mapping locations, 204
intents, 205
panning map view, 209
zooming map view, 210
leveraging
Amazon Appstore in-app billing APIs, 426
Android Market in-app billing APIs, 425-426
billing APIs, 427
hardware acceleration, 297
License Verification Library, 444-445
OpenGL ES in Android, 316
PayPal in-app billing APIs, 426
libraries adding to Eclipse projects, 431
License Verification Library (LVL), leveraging, 444-445
lights, blinking (notifications), 92-93
limitations
of SQLite, 469
linear gradients, 282
listening
for events on the entire screen, 128-129
for touch mode changes, 127-128
listing
ADB commands, 448
connected devices and emulators, ADB, 447
ListView container, 51
live wallpaper, 375
configuring Android manifest files, 379
creating, 376
creating configurations, 378
installing, 379
service engine, implementing, 377-378
live wallpaper service, implementing, 377
live wallpaper service engine, implementing, 377-378
loadAndCompileShader() method, 344
Loader class, 14
loading
animations, 306
locale support, implementing programmatically, 421
locating content using URIs, 67
location-based services. See LBS
LocationListener, 199
LocationListener object, 22-23
LocationManager object, 199
locations
mapping, 204
intents, 205
panning map view, 209
zooming map view, 210
log information, filtering (ADB), 453-454
LogCat, 144
ADB, 452
accessing secondary logs, 455
displaying log information, 452
filtering log information, 453-454
including date and time with log data, 452
redirecting log output to files, 454
logging
events, Google Analytics SDK, 432
logs, clearing (LogCat), 454
long clicks, listening for, 129-130
LVL (License Verification Library), 444-445
managing
accounts with Account Manager, 405-406
WebView state, 189
manifest files
configuring for Android Beam, 272
updating, 65
map view
panning, 209
zooming, 210
MapActivity, 206
MapController object, 207
mapping locations, 204
intents, 205
panning map view, 209
zooming map view, 210
MapView object, 206
MapView XML, 206
marking the spot, mapping locations, 211-216
Matrix class, 287
matrixes, transforming bitmaps, 287-288
measureText() method, 287
menus, 100
popup menus, 105
message flow, C2DM, 400
mobile networking, 169
Mobile Payment Libraries, 426
mode settings, cameras, 225
modifying WebView settings with WebSettings, 186
monitoring
signal strength and data connection speed, 243
moving transformations, animations, 308
audio, 233
playing, 235
sharing, 236
cameras, 220
assigning images as wallpaper, 227-228
capturing still images, 220-225
choosing from device cameras, 228-229
face detection, 233
mode settings, 225
parameters, 225
video. See video
zooming, 226
ringtones, 238
native activities, Android NDK, 362
native code, exceptions (Android NDK), 360-362
Native Development Kit. See Android NDK
Near Field Communications (NFC), 269
network operations, handling asynchronously, 174-176
displaying images from network resources, 177-179
network resources, displaying images from, 177-179
networking, strict mode, 170
NFC (Near Field Communications), 269
noises, notifications, 93
NotificationManager, 85
clearing, 90
compatibility, 84
designing, 96
noises, 93
NotificationManager service, 85
test notification with icons, 85-86
notify() method, 86
notifyChange() method, 64
obfuscating with ProGuard, 443
error reports, 444
objects
SQLite databases, deleting, 47
onActivityResult() method, 154
onAnimateMove() method, 138
onBackup() method, 411
onClick() method, 233
onCreate() method, 215
onCreateContextMenu() method, 104
onCreateLoader() method, 14
onDestroy() method, 22
onDetachedFromWindow() method, 351
onDoubleTap, 132
onDoubleTapEvent, 132
onDown, 132
onFling, 133
onInit() method, 156
onKeyDown() method, 336
onKeyUp() method, 336
onLoaderReset() method, 14
onLoadFinished() method, 14
onLocationChanged() method, 200
onLongPress, 132
onOptionsItemSelected() method, 102, 112
onPause() method, 189
onPostExecute() method, 11
onPreExecute() method, 11
onProgressUpdate() method, 11
onReceive() callback method, 32
onReceive() method, 369
onRestore() method, 411
onScale() helper method, 140
onScroll, 133
onSensorChanged() method, 257
onServiceConnected() method, 26
onServiceDisconnected() method, 26
onServiceStateChanged method, 241
onShowPress, 132
onSingleTapConfirmed, 132
onSingleTapUp, 132
onStart() method, 18
onStartCommand() method, 18
onSurfaceCreate(), 342
onSurfaceCreated() method, 340
onTouchEvent() method, 139
onTrackballEvent(), 143
onUpdate() method, 372
OpenGL, 315
enabling application threads to talk to, 335-337
enabling OpenGL threads to talk to application threads, 333-334
OpenGL ES, 315
APIs in Android SDK, 317
cleaning up, 337
drawing 3D objects
coloring vertices, 326
handling tasks manually, 318
drawing on the screen, 323-324
initializing GL, 323
leveraging in Android, 316
OpenGL ES 1.x, 341
OpenGL ES 2.0, 341
configuring applications for, 341
openOrCreateDatabase() method, 36
optimizing web applications for Google TV, 165
ordered broadcasts, 73
sending, 74
OrientationEventListener, 145
Paint gradients, 281
paired devices, querying for, 265
panning map view, 209
parameters
cameras, 225
parsing XML from the network, 172-174
pasting data to system clipboard, 127
pauseTimers(), 189
PayPal in-app billing APIs, leveraging, 426
performance of graphics, improving (Android NDK), 362-363
permission
to access phone state information, 240
gaining to send and receive SMS messages, 244
persistent database, designing, 47
field names, 48
PetTracker, 47
PetTracker3, 67
phone calls
receiving, 251
phone state information, gaining permission to access, 240
phones, vibrating notifications, 91-92
piracy. See software piracy
playing
audio, 235
video, 231
popup menus, 105
PrefListenerService class, 372
privacy, Google Analytics, 439
programmatically defining
property animations, 311
shape drawables, 290
tweened animations, 305
programmatically implementing locale support, 421
configuring for your apps, 443-444
error reports, 444
projects, Android NDK, 357-358
calling native code from Java, 358-359
exceptions with native code, 360-362
native activities, 362
parameters and return values, 359-360
property animation, 309
defining programmatically, 311
starting programmatically, 312
providing backup agent implementation, 409
publishing applications for foreign users, 422
publishProgress() method, 11
queries, executing, 44
raw queries, 46
SQLiteQueryBuilder, 45
query results, iterating rows of (SQLite databases), 42-43
query() method, 44
querying
multiple tables with JOIN, SQLite, 474
for paired devices, Bluetooth, 265
SQLite databases, 41
iterating rows of query results and extracting data, 42-43
tables with SELECT (SQLite), 471
radical gradients, 283
raw queries, executing, 46
rawQuery() method, 46
reconfiguring manifest files for Android Beam, 272
reading
receiving
Android Beam messages, 271-272
broadcasts, 75
handling incoming broadcasts, 77-79
registering to receive, 76
registering to receive dynamically, 76-77
registering to receive statically, 77
phone calls, 251
recording
records
deleting in SQLiteDatabase class, 39
inserting in SQLiteDatabase class, 38
updating in SQLiteDatabase class, 39
rectangles, drawing, 291
redirecting log output to files, LogCat, 454
references to sensors, acquiring, 256
registerForContextMenu(), 103
registering
with Android Backup Service, 408
backup agents in application manifest files, 412
intent filter, 384
to receive broadcasts, 76
statically, 77
registerListener() method, 258
reinstalling applications, ADB, 451
release() method, 235
remote backup services, 408
remote interfaces, implementing 24-26
remote view, creating App Widgets, 370-371
RemoteViews object, 373
rendering to custom view control, 350-352
versus Android NDK, 363
defining functionality, 346-350
rendering to custom view control, 350-352
RenderScriptGL object, 349
reports
eCommerce reports, reviewing, 437
error reports, ProGuard, 444
requesting
backups, 412
OpenGL ES 2.0 surfaces, 341-345
restores, 413
service information, 242
restore operations, forcing (ADB), 456
restores, requesting, 413
retrieving
Android network status, 179-180
content provider data with CursorLoader, 68-69
files to devices or emulators, 450
gallery images, 71
return values, Android NDK, 359-360
reviewing eCommerce reports, 437
ringtones, 238
rotating transformations, animations, 307
rsgClearColor(), 348
RSSurfaceView class, 350
saving images to databases, 71
ScaleGestureDetector, 132, 140
scaling bitmap graphics, 287
scaling transformations, animations, 308
ScanResult object, 275
schema objects, creating SQLite, 37-38
screen orientation changes, 144-146
screen requirements, text, 287
screen space, device diversity, 161-162
screens that do not require action bars, 114
scroll gesture, 133
ScrubActivity class, 112
SDK (Software Development Kit), 17
search activity, creating, 392-394
search configurations, creating, 387
search suggestions, enabling, 387-390
searches
Android manifest files, configuring, 394-395
basic searches, enabling, 387
creating configurations, 387
enabling in applications, 386-387
global search
enabling, 395
updating search configurations, 396
updating search setting, 397
making application content searchable, 385-386
suggestions, enabling, 387-390
voice search, enabling, 390
secondary logs, acessing (LogCat), 455
secure coding practices, software piracy, 442
securing application broadcasts, 80
SELECT, querying tables (SQLite), 471
sending
files to devices or emulators, 450
sendMultipartTestMessage() method, 248
SensorManager class, 255
sensors. See device sensors
sequential tweened animations, 305
service information, requesting, 242
service lifecycle, 18
<service> tags, 23
services
determining when to use, 17
lifecycles of, 18
Session Initiated Protocol (SIP), 251
setAccuracy() method, 199
setAnchorView() method, 231
setARGB() method, 281
setColor() method, 281
setDisplayHomeAsUpEnabled() method, 113
setImageURI() method, 70
setInitialScale() method, 186
setInterpolator() method, 314
setMediaController() method, 231
setNotificationUri() method, 60
setOnFocusChangeListener() method, 130
setOnNdefPushCompleteCallback() method, 271
setShader() method, 282
setTables() method, 60
setTheme(), 119
SGI (Silicon Graphics), 315
Shape class, 289
shape drawables, defining
programmatically, 290
as XML resources, 289
ShapeDrawable class, 289
shapes, 289
defining shape drawables
as XML resources, 289
programmatically, 290
drawing, 291
rectangles and squares, 291
rectangles with rounded corners, 291-293
sharing
audio, 236
shell, ADB (inspecting SQLite databases), 456
shell commands, issuing, 449-450
shell sessions, 449
shells, stress testing applications (ADB), 456-458
Short Message Service. See SMS
signal strength, monitoring, 243
signing up for C2DM, 401
Silicon Graphics (SGI), 315
SimpleCursorAdapter, binding data, 51-54
SimpleDataUpdateService class, 372
simultaneous tweened animations, 305
single-touch gestures, 132-138
SIP (Session Initiated Protocol), 251
SMS (Short Message Service), 239, 244
gaining permission to send and receive messages, 244
SmsManager.divideMessage() method, 248
software piracy, 441
configuring ProGuard for your apps, 443-444
leveraging License Verification Library, 444-445
obfuscating with ProGuard, 442-443
error reports, 44
secure coding practices, 442
speak() method, 157
SQLite, 463
executing commands on command line, 468
importing/exporting databases, 466-468
limitations of, 469
sqlite3 command-line interface, 464
connecting to SQLite databases, 464
launching ADB shell, 464
sqlite3 commands, 469
student grade database example, 469
altering and updating data in tables, 473
creating tables with AUTOINCREMENT, 470
deleting tables, 476
designing, 470
foreign keys and composite primary keys, 472
inserting data into tables, 471
querying multiple tables with JOIN, 474
querying tables with SELECT, 471
subqueries for calculated columns, 476
SQLite database instances, deleting with application context, 47
SQLite databases
closing, 47
configuring properties, 37
creating, 36
instances with application context, 36
tables and schema objects, 37-38
deleting tables and objects, 47
inspecting with shell, 456
queries, executing, 44
raw queries, 46
with SQLiteQueryBuilder, 45
querying, 41
iterating rows of query results and extracting data, 42-43
storing structured data, 35-36
sqlite3 command-line interface, 464
connecting to SQLite databases, 464
launching ADB shell, 464
sqlite3 commands, 469
SQLiteDatabase class
deleting records, 39
inserting records, 38
updating records, 39
SQLiteQueryBuilder, executing queries, 45
squares, drawing, 291
startActivity() method, 250
startActivityForResult() method, 154
startDiscovery() method, 265
starting
ADB server process, 448
startManagingCursor(), 42
startService() method, 18
startSmoothZoom() method, 226
statistics, gathering with Google Analytics, 438-439
status bar, notifications, 84-85
NotificationManager service, 85
text notifications with icons, 85-86
stdio sprintf() call, 359
still images, capturing with cameras, 220-225
stop() method, 235
stopping ADB server process, 448
stopScan() method, 274
stopService() method, 24
stopSmoothZoom() method, 226
storing structured data with SQLite databases, 35-36
stress testing applications, shell (ADB), 456-458
networking, 170
structured data, storing with SQLite databases, 35-36
student grade database example, 469
altering and updating data in tables, 473
creating tables with AUTOINCREMENT, 470
deleting tables, 476
designing, 470
foreign keys and composite primary keys, 472
inserting data into tables, 471
querying multiple tables with JOIN, 474
querying tables with SELECT, 471
subqueries for calculated columns, 476
style inheritance, leveraging, 117-119
styles, 114
leveraging style inheritance, 117-119
Paint, 281
subqueries for calculated columns, SQLite, 476
@SuppressWarnings option, 362
surfaceChanged() method, 351
surfaces, requesting OpenGL ES 2.0 surfaces, 341-345
SurfaceView, OpenGL ES, 318-319
sweep gradients, 283
sync adapters, synchronizing data, 406-407
synchronizing data with sync adapters, 406-407
tables
altering and updating data, SQLite, 473
creating with AUTOINCREMENT (SQLite), 470
deleting in SQLite, 476
inserting data, SQLite, 471
querying with SELECT (SQLite), 471
querying multiple, with JOIN (SQLite), 474
SQLite database, creating, 37-38
SQLite databases, deleting, 47
tablets, developing applications for, 162-163
tags, 384
telephony utilities, 239
gaining permission to access phone state information, 240
monitoring signal strength and data connection speed, 243
phone calls
receiving, 251
requesting call state, 240-242
requesting service information, 242
SIP (Session Initiated Protocol), 251
SMS, 244
gaining permission to send and receive messages, 244
TelephonyManager, 240
text, 284
default fonts and typefaces, 284-285
screen requirements, 287
text notifications with icons, 85-86
text prediction, 126
Text-To-Speech services (TTS), 149, 155-157
TextToSpeech.OnInitListener, 156
textual input methods, 123
clipboard, 126
copying data to, 127
pasting data to, 127
text prediction, 126
user dictionaries, 126
threads
application threads, talking to OpenGL threads, 335-337
enabling OpenGL threads to talk to application threads, 333-334
toggleFPSDisplay() method, 336
touch mode, listening for changes, 127-128
trackballs, 143
tracking ad and market referrals, 438
trackTransactions() method, 437
transactions, SQLite databases, 40-41
transformations, tweened animation
moving transformations, 308
rotating transformations, 307
scaling transformations, 308
transparency transformations, 307
transforming bitmaps with matrixes, 287-288
transparency transformations, animations, 307
true north, finding, 258
loading, 306
moving transformations, 308
programmatically, 305
rotating transformations, 307
scaling transformations, 308
transparency transformations, 307
as XML resources, 304
TYPE_ACCELEROMETER, 255
TYPE_AMBIENT_TEMPERATURE, 255
TYPE_LIGHT, 255
TYPE_MAGNETIC_FIELD, 255
TYPE_PRESSURE, 255
TYPE_PROXIMITY, 255
TYPE_RELATIVE_HUMIDITY, 255
uninstalling applications, ADB, 452
update services, App Widgets, 372-373
update() method, content providers, 62-63
updating
App Widgets, 372
data in tables, SQLite, 473
manifest files, 65
records, SQLiteDatabase class, 39
search configurations for global searches, 396
search settings for global searches, 397
URIs, locating content on Android systems, 67
USB, 267
accessories, 268
hosts, 269
UsbManager class, 268
user dictionaries, 126
user events, 127
listening for
events on the entire screen, 128-129
user interface guidelines, 99
advanced features, 114
application icon clicks, 112-113
contextual action mode, 114
screens that do not require action bars, 114
menus, 100
popup menus, 105
styles, 114
leveraging style inheritance, 117-119
user motions, detecting within views, 131-132
users
attracting with device diversity, 161
vertices, coloring, 326
vibrating phones, notifications, 91-92
vibration patterns, 91
video, 229
playing, 231
videoRecorder object, 230
view animation, 304
views
detecting user motions, 131-132
ViewTreeObserver class, 128
voice search, enabling, 390
wallpaper, assigning images, 227-228
web
browsing with WebView, 183-184
web applications, optimizing for Google TV, 165
web extensions, building with WebKit, 190
WebChromeClient, adding browser chrome, 188-189
WebChromeClient class, 192
WebKit
APIs, browsing, 190
building web extensions, 190
extending functionality to Android, 190-195
WebSettings, modifying WebView settings, 186
WebView
adding features to, 186
designing layouts, 184
handling events with WebViewClient, 186-187
managing, 189
modifying settings with WebSettings, 186
WebViewClient, handling WebView events, 186-187
Wi-Fi, 273
Wi-Fi Direct, 273
Wi-Fi Direct, 273
WifiConfiguration object, 276
WifiManager object, 276
wiping, archived data (ADB), 456
world Magnetic Model, 258
writeToParcel() method, 28
XML, parsing from the network, 172-174
XML resources
shape drawables, 289
tweened nimations, 304
XMPP (Extensible Messaging and Presence Protocol), 403
zooming
cameras, 226
map view, 210
3.144.1.225