* (asterisk), filtering log information, 475
. (dot), sqlite3 commands, 486
; (semicolon), sqlite3, 490
AbstractAccountAuthenticator class, 428
AbstractThreadedSyncAdapter class, 429
AccelerateDecelerateInterpolator, 341
AccelerateInterpolator, 341
ACCESS_COARSE_LOCATION permission, 212
Access control, SQLite limitations, 491
Access points, listing, 248
overview of, 139
speech recognition services, 141–145
testing, 147
text-to-speech services, 145–147
Accessories
Account authenticator, 428
Account provider, 428
Accounts. See User accounts
ACCURACY_COARSE, location services, 255
ACCURACY_COARSE_LOCATION, 261
ACCURACY_FINE, location services, 255
ACCURACY_FINE_LOCATION, 261
Achievements, Google Play game services, 297–298
contextual action mode, 105–106
handling application icon clicks on, 103–104
working with screens not requiring, 104–105
ActionMode class, 104
ACTION_RECOGNIZE_SPEECH, 145
ACTION_REQUEST_DISCOVERABLE intent, Bluetooth, 237
ACTION_REQUEST_ENABLE intent, Bluetooth, 237
ActionScript 3, 188
ACTION_VIEW intent, Google Maps, 263
Activity class
application acting as content filter, 410–412
asynchronously loading data, 16
configuring default messaging, 217
creating App Widget, 393
data for Google Analytics, 287
gathering statistics, 292
launching browser, 176
native activities, 384
OpenGL/application threads, 362–364
software keyboards, 116
Activity lifecycle
spanning processing across, 19
text notifications, 80
ActivityOptions class, 341
Activity recognition APIs, Google location services, 261–262
<activity> tag
application acting as content filter, 411
enabling application search, 424
hardware acceleration control, 325
registering intent filter, 413
themes, 111
accessing sqlite3 from, 486
backup service controls, 476–477
copying files, 472
directing commands to specific devices, 470
generating bug reports, 477–478
inspecting SQLite databases with shell, 478
installing custom binaries, 481–482
installing/uninstalling applications, 473
issuing shell commands, 471–472
listing connected devices/emulators, 469
overview of, 469
starting ADB server, 470
stopping ADB server, 470
stress testing applications with shell, 478–481
addGlobalLayoutListener() method, 121
addJavascriptInterface() method, 183, 187
addOnDrawListener() method, 121
addOnPreDrawListener() method, 120
addOnTouchModeChangeListener() method, 120
addURI() method, 419
ADK (Android Accessory Development Kit), 139, 239–240
Admin permissions, Bluetooth, 235, 237–238
Admin section, Google Analytics, 284–285
ADT (Android Development Tools), 111, 500
ADT-1 Developer Kit, Android TV, 465
Ahead-of-time (AOT) compilation, ART runtime, 460
AIDL (Android Interface Definition Language), 26–28
AlarmManager class, App Widgets, 396
Alarms, system event, 208
Alerts, proximity, 260
All Apps button, language settings, 442
Alpha transparency transformations, 334–335
ALTER TABLE, SQLite limitations, 491
Alternative resources
changing language settings, 442–444
device diversity, 153
Amazon Appstore for Android, 280
Android Accessory Development Kit (ADK), 139, 239–240
Android Backup Service, 430–435
Android Beam
configuring manifest file, 244–245
host card emulation, 245
over Bluetooth, 245
overview of, 241
Android Debug Bridge. See ADB (Android Debug Bridge)
Android Developers Blog, 117
Android Development Tools (ADT), 111, 500
Android Interface Definition Language (AIDL), 26–28
doing more, 260
overview of, 253
Android NDK (Native Development Kit)
improving graphics performance, 384–385
installing, 378
leveraging OpenGL ES, 346
sample application, 379
Android NDK (Native Development Kit), creating project
calling native code from Java, 380–381
parameters and return values, 381–382
using exceptions with native code, 382–383
using native activities, 384
Android Runtime (ART), L Developer Preview, 460–461
Android SDK
configuring Android Studio, 508–509
getting familiar with Java documentation, 500
License Agreement, 174
OpenGL ES APIs in, 347
OpenGL ES in Android, 346
using Android NDK vs., 377–378
versions of OpenGL ES, 346
debugging applications, 515–517
getting up and running, 507–508
Gradle build system, 513
keyboard shortcuts, 517
launching for first time, 508
learning Java development tools, 500
overview of, 507
project structure, 512
android.accounts package, 427–429
android.animation package, 339
android.database.sqlite package, 36
AndroidManifest.xml file
building content provider, 62
configuring Android Beam, 244–245
configuring App Widgets, 399
configuring live wallpapers, 406–407
creating Service, 20
enabling vibration with notifications, 84
permissions, 25
registering backup agent, 434
securing application broadcasts, 74
android.permission.INTERNET permission, 175–176
android.transition, animation, 342
android.view.animation package
alpha transparency transformations, 335
Interpolator class, 341
loading animations, 334
moving transformations, 336
rotating transformations, 335
scaling transformations, 336
tweened animations, 333
android.webkit package, 182–187
animate() method, property animations, 339–340
animateCamera() method, 267
Activity launch, 341
in L Developer Preview, 462–463
scenes and transitions for state, 342
types of graphic, 329
working with interpolators, 341
AnimationDrawable class, 330
AnimationListener class, 334
AnimationSet, 333
AnimationUtils helper class, 334
Animator.AnimatorPauseListener, property animation, 337
ANR (Application Not Responding) events, 11–12
Anti-aliasing, Paint, 307
AnticipateInterpolator, 341
AnticipateOvershootInterpolator, 341
Antipiracy. See also Software piracy protection, 299–300
AOT (ahead-of-time) compilation, ART runtime, 460
API Access link, maps, 263
APIs, Android
multimedia. See Multimedia APIs
networking. See Networking APIs
optional hardware. See Hardware APIs
telephony. See Telephony APIs
web APIs. See Web APIs
Apple, Siri speech-recognizing assistant, 139
Application Context, SQLite database, 36, 46
Application lifecycle, 41
Application Not Responding (ANR) events, 11–12
Applications
App Widgets tied to underlying, 392
gathering statistics. See Google Analytics
gathering statistics from, 292
handling icon clicks on action bar, 103–104
searching. See Search
<application> tag, AndroidManifest.xml file
controlling hardware acceleration, 325
registering backup agent, 434
restricted profiles, 429
right-to-left language localization, 445
AppStateManager class, 299
AppWidgetProvider class, 395–397
<appwidget-provider> tag, 394, 402
adding to Lock screen, 401–403
becoming host, 401
calculating size of, 394
configuring Android manifest file for, 399
defined, 392
installing to Home screen, 400–401
Archived data, wiping, 477
ArgbEvaluator class, property animation, 337
ARMv5TE devices, Android NDK, 379–380
ArrayAdapter, binding data to controls, 53
Arrays, drawing vertices, 353–355
ART (Android Runtime), L Developer Preview, 460–461
Asterisk (*), filtering log information, 475
Asynchronous network operations, 167–169, 260
AsyncTask class, 12–14, 168, 314
Attributes, property animation, 338
attracting new types of device, 153
for this book, 1
Audio
AudioManager, 206
Auditing, SQLite limitations, 491
Authors of this book, contacting, 8
AutoCompleteTextView control, 50, 53, 118
AUTOINCREMENT, SQLite database tables, 492
AVD, Android location services APIs, 256
Background processing
Backup Manager, 434–435, 476–477
controlling using ADB command, 476–477
forcing backup operations, 477
forcing restore operations, 477
implementing backup agent, 432–435
overview of, 430
registering with Android, 432
requesting backup, 434
requesting restore, 435
wiping archived data, 477
BaseColumns interface, database field names, 47
BaseGameActivity class, Google Play game services, 296–297
BasicGLThread class, OpenGL ES, 349–350
basicNativeCall() method, 381
Battery
optimization in Project Volta, 461
beginTransaction() method, SQLite database transactions, 40
Bidi Formatter utility class, 445
BigPictureStyle class, notifications, 88–90
bigText() method, notifications, 88–90
BigTextStyle class, notifications, 88–90
Binding data, to application user interface, 48–53
bindService() method, 20–21, 27
Bitmap graphics
buffering issues of large, 170
drawing on Canvas, 313
performance optimizations, 314–315
scaling, 313
transforming using Matrix, 313–314
working with, 312
working with view animations, 331–332
BLE (Bluetooth Low Energy) peripheral devices, 235–236
Blinking lights, notifications, 84–85
Blocking operations, 11
Android Beam over, 245
checking hardware for, 236–237
enabling, 237
establishing connections between devices, 238–239
querying for paired devices, 237
BluetoothAdapter class, 236–238
BLUETOOTH_ADMIN permission, 235, 237–238
Bluetooth Low Energy (BLE) peripheral devices, 235–236
BLUETOOTH permission, 235
BluetoothSocket object, 238
Body text, notifications, 79
BounceInterpolator, animation, 341
Breakpoints, debugging Android Studio applications, 515–516
BroadcastIntent class, 31–32, 207, 231
BroadcastReceiver class
default messaging application, 217
GSM message flow, 272
monitoring device battery, 231–233
monitoring Wi-Fi state, 247
overview of, 67
Browser chrome, WebView control, 179–180
Buffering issues, large bitmaps, 170
Buffers
build() method
animating map camera, 267
creating text notification with icon, 80
Built-in functions, SQLite limitations, 491
Button control
applying styles, 108
listening for long click on, 122
recording speech, 145
ByteBuffer, drawing 3D objects, 356–358
C2DM (Cloud to Device Messaging), 271
CacheManager class, WebKit API, 182
calculateAndDisplayFPS() method, OpenGL, 362–364
Calculated columns, SQLite database, 496–497
calculateSignalLevel() method, WifiManager, 247–248
Call button, phone calls, 220–221
CallVoidMethod() function, exceptions with native code, 383
Camera, positioning and animating map, 266–268
Camera class
assigning still images as wallpaper, 199
capturing still images, 192–196
choosing among devices, 199–200
common parameters, 197
configuring settings, 196
sharing images, 198
working with multimedia, 191–192
zooming, 197
CameraPosition object, 267
CameraSurfaceView class, 192–196
Campaign tracking, Google Play, 292
cancel() method, notifications, 83
cancelDiscovery() method, Bluetooth devices, 238
canDetectOrientation() method, screens, 136
Canvas object
drawing bitmaps, 313
drawing on screen with Paint and, 305–309
hardware acceleration and, 325
understanding, 307
capture() method, Camera, 196
CardView, L Developer Preview, 462
CCS (Cloud Connection Server), Google, 272, 274
Chaining methods, Java, 501
CHANGE_WIFI_STATE permission, 246
Character encodings, internationalization, 445
CheckJNI tool, 460
Chrome DevTools, debugging WebView, 187
Chromium rendering engine, WebView, 175
Classes, Java
documentation, 500
method chaining in builder-style, 501
Classic Bluetooth. See also Bluetooth, 235–236
cleanupgl() method, OpenGL ES, 366
clear() method, wallpaper, 199
Clearing log, 476
Click events, long click, 121–122
Client, integrating GCM on Android, 273–274
Clipboard framework, textual input, 118–119
ClipboardManager, 119
close() method
Cursor management, 41
SQLite database, 46
Cloud Connection Server (CCS), Google, 272, 274
Cloud Save, game data, 299
Cloud to Device Messaging (C2DM), 271
Code
secure practices, 450
Color
building simple styles, 107–109
Google TV, 157
indicator lights for notifications, 84–85
L Developer Preview, 462
Columns
building content provider, 56–57
data types for SQLite database, 492
raw queries, 45
SQLite database calculated, 496–497
compare() method, PhoneNumberUtils, 215
compareSignalLevel() method, WifiManager, 247–248
Compatibility
development environments, 6
Composite primary keys, SQLite database tables, 493–494
Concurrency, SQLite limitations, 490
CONFIG_CHECK_GL_ERROR flag, initializing GLS, 351
Configuration Activity, App Widgets, 395
Connections
between Bluetooth devices, 238–239
buffering of large bitmaps over slow, 170
fused location provider, 261
geocoding requiring network, 260
implementing remote interface, 27
retrieving Android network status, 171–173
ConnectivityManager class, 171–173
ConsoleMessage class, WebKit API, 182
Constants, Sensor class, 227
Content
selling through billing APIs, 278
web extensions, 183
acting as, 55
data URI, 56
insert() method, 59
searches in applications, 417–420
sharing images, 198
SQLite database acting as, 485
updating manifest file, 62
UserDictionary, 118
ContentResolver
retrieving content provider data, 64–65
sharing audio, 206
sharing images, 198
ContentValues object, update(), 38–39
Context menu, long-click events, 121
Contextual action mode, action bars, 105–106
Contractible notifications, 88–90
Controls
for accessibility, 140
hardware acceleration, 325
Conventions, used in this book, 7
CookieManager class, WebKit API, 182
Copying
ADB commands for files, 472
data to system clipboard, 119
CREATE_AUTHOR_TABLE, SQL, 37
CreateBeamUrisCallback interface, Android Beam, 245
createBitmap() method, 313
CreateNdefMessage() method, Android Beam, 242–243
CREATE TABLE SQL statement, 37
CREATE TRIGGER SQL statement, 38
Credentials, user account, 428
Criteria object, device location, 255
CursorLoader, search Activity, 423
Cursor object
binding data to controls, 50–53
content provider query(), 57
querying SQLite databases, 41–42
retrieving content provider data, 64
Custom binaries, installing, 481–482
CustomGL2SurfaceView class, OpenGL ES 2.0, 370
Customizing
backup services, 431
Home screen wallpaper, 192, 199
software keyboards, 117
View controls for accessibility, 140
Custom Locale application, 442
CustomRenderer class, OpenGL ES 2.0, 370
CycleInterpolator, animation, 341
Cygwin 1.7 or later, Android NDK, 378
Dalvik Debug Monitor Service. See DDMS (Dalvik Debug Monitor Service)
Data
adding to SQLite database, 492
altering/updating in SQLite database, 495
binding to application user interface, 48–53
building content provider, 56–57
collecting for Google Analytics, 287
gathering statistical, 292–293
Google Analytics tracking e-commerce, 290–292
retrieving content provider, 64–65
dataChanged() method, backups, 434
Data sources, 16
Data types, 492
DateFormat utility class, localizing language, 445
Daydream (screen saver), 408–410
DDMS (Dalvik Debug Monitor Service)
dumping database contents, 489
inspecting database files, 485
simulating call states, 213
deactivate() method, Cursor, 41
Debugging
with ADB. See ADB (Android Debug Bridge)
Android NDK applications, 379
Android Studio applications, 515–517
ART runtime improvements, 460
database files with DDMS, 485, 489
on devices connected to USB hardware, 239
error reports after ProGuard tool, 452
WebView control, 187
DecelerateInterpolator, animation, 341
Default Keymap Reference, Android Studio, 517
Default messaging application, 215–216
delete() method, content provider, 60–61
deleteDatabase() method, SQLite, 46
Design
accessibility. See Accessible applications
user interface. See User interface
Design view, Android Studio, 514
Development environments, used in this book, 5–6
Devices
attracting new types of users, 153
copying files to, 472
determining locale of, 444
determining location of, 254–256
directing ADB commands to specific, 470
disallowing sqlite3, 487
flexible user interfaces for, 152
indicator light support, 84–85
input methods, 115
installing custom binaries, 481–482
listing all Android connected, 469
live wallpaper warning, 406
notification support, 78
OpenGL ES compatibility with, 346–347
presumptions about features, 151–152
retrieving files from, 472
sensor support, 227
testing sensors on physical, 227
using Multimedia APIs. See Multimedia APIs
devices command, adb command, 469
Dimensions, flexible user interface, 152
dimens.xml file, styles, 107–109
disable() method, screen orientation, 136
Discovering devices, Bluetooth, 237–238
doAlert() function, web extensions, 185
doConsoleLog() function, web extensions, 185
Documentation, Java, 500
doInBackground() method, AsyncTask, 13
Domain-specific language (DSL), Gradle, 513
doServiceStart() method, 22
doSetFormText() function, web extensions, 185–186
Dot (.), sqlite3 commands, 486
doToast() function, web extensions, 185
Double-tap gestures, 124–125, 128–129
DragAndDropDemo.java, 134
Drag-and-drop framework, 134
Dragging, single-touch gesture, 124
DragShadowBuilder class, 134
draw() method, coloring vertices, 355–356
Drawable object, 171
Drawable resources, L Developer Preview, 462
drawFrame() method, 366–367, 372, 384–385
with canvases and paint, 305–308
overview of, 305
with radial gradients, 309
with sweep gradients, 309
defined, 345
Drawing on screen
2D objects. See Drawing 2D objects
3D objects. See Drawing 3D objects
DreamService class, Daydream, 409
droid_wallpaper.xml, 407
DROP TABLE command, SQLite database, 46, 497
DSL (domain-specific language), Gradle, 513
dump command, sqlite3, 488
dumpsys batterystats, Project Volta, 461
duration attribute, property animation, 338
duration property, tweened animations, 333
E-commerce overview reports, Google Analytics, 290–292
EditText control
basic searches, 417
choosing software keyboard, 116–117
listening for focus changes, 122–123
speech recognition, 141
working with phone numbers, 215
EGL (Embedded-System Graphics Library), 345, 350–352
EGL10.EGL_DEFAULT_DISPLAY, GLS, 351
eglDestroyContext() method, OpenGL ES, 366
eglDestroySurface() method, OpenGL ES, 366
eglMakeCurrent() method, OpenGL ES, 366
eglTerminate() method, OpenGL ES, 366
elevation attribute, CardView, 462
Embedded-System Graphics Library (EGL), 345, 350–352
Emulators
allowing sqlite3 command, 487
copying files to, 472
installing custom binaries, 481–482
locating your, 256
network settings, 173
nonsupport for simulating hardware sensors, 225
retrieving files from, 472
using ADB shell to start/stop, 471–472
using ADB to list all Android connected, 469
enable() method
Bluetooth, 237
screen orientation, 136
endTransaction() method, SQLite databases, 40
Enunciation, speech recognition, 142
Error checking, conventions used in this book, 7
Evaluator classes, property animation, 337
Event handling
View control, 140
XML Pull Parser, 167
Events
filtering logs of certain severity, 475
gathering statistics, 292
Google Analytics Dashboard reports, 288
interacting with OpenGL ES and Android, 362–365
listening for focus changes, 122–123
listening for long clicks, 121–122
listening for on entire screen, 120–121
listening for touch mode changes, 119–120
live wallpaper responding to user, 406
logging e-commerce, in Google Analytics, 290–291
logging in Google Analytics, 287
stress testing applications with monkey, 478–481
ExceptionDescribe() function, native code, 383
Exception handling
conventions used in this book, 7
networking code and, 165
ExceptionOccurred() function, native code, 383
Exceptions, with native code, 384
execSQL() method, SQLite database, 37
executing tasks in parallel, 14
parallel execute, 14
executeOnExecutor() method, parallel execute, 14
Exerciser Monkey tool, ADB shell, 478–481
Expandable notifications, 88–90
exported attribute, <intent-filter> tag, 74
Exporting, database/data with sqlite3, 488
Extending Android application reach
acting as content type handler, 410–411
with App Widgets. See App Widgets
determining Intent actions/MIME types, 411–413
extensions, building web, 182–187
Extract as Style, styles, 111
EXTRA_LANGUAGE_MODEL, RecognizerIntent, 145
EXTRA_PROMPT, RecognizerIntent, 145
Features
antipiracy tips, 453
avoiding presumptions about device, 151–154
specifying multimedia, 191–192
Field names, tracking database, 47
FileBackupHelper class, 432–434
FileLock, backup helper, 434
File pointers, Cursor objects as, 41–42
Files
Android Studio project structure, 512
executing SQL scripts with sqlite3, 489
implementing backup helper for, 432
redirecting log output to, 476
sending output with sqlite3, 488
SQLite databases as private, 485
standard format for database, 485
fillAfter property, moving transformations, 336
Filtering log information, LogCat, 474–475
findViewById() method, web extensions, 183
Finger gestures. See Gestures
Fingerprint, map API key, 263–264
Flash
optimizing for Google TV, 157
Flickr image, displaying, 170–171
FloatBuffer() method, drawing vertices, 354–355
FloatEvaluator class, property animation, 337
Folders, Android Studio projects, 512
Fonts
conventions used in this book, 7
customizing typefaces, 310–312
enabling accessibility, 140
modifying WebView control, 178
using default, 310
for-each loops, looping infinitely, 502
Foreground, designing notifications, 91
Foreign keys, SQLite database, 37–38, 493–494
for loops, looping infinitely, 501–502
format() method, locale strings, 445
formatJapaneseNumber() method, phone numbers, 215
formatNumber() method, phone numbers, 215–216
Fragment
asynchronously loading data to, 16
gathering statistics, 292
launching Google Maps, 265–266
for tablets, 155
for user interfaces, 152
Frame-by-frame animations, 329–331
Frame rate, OpenGL/application threads, 363–364
FrameLayout, 349
Freemium business model, 277–279
fromAlpha value, alpha transparency transformations, 334–335
fromDegrees property, transformations, 335
fromXDelta, fromYDelta values, transformations, 336
fromXScale, fromYScale values, transformations, 335–336
FTS3 extension, SQLite, 420
Functions, Service for routine/regular, 19
Fused location provider, Google location services, 260–261
GameHelper class, Google Play game services, 296–297
Gaming
design challenges of, 154
Google Play. See Google Play game services
secure coding practices, 450
Garbage collection (GC), ART runtime, 460
GC (garbage collection), ART runtime, 460
incorporating into applications, 273–274
message flow, 272
sample applications, 274
signing up for, 273
Geocaching, 260
Geofencing APIs, 262
GeomagneticField class, true north, 230
gesture package, 124
GestureDetector class, 123–129
GestureListener class, 129, 132
GestureOverlayView, 124
common multitouch, 133
detecting user motions within View
, 123–124
natural-looking, 133
user input with, 123
using drag-and-drop framework, 134
getAccessoryList() method, USB, 240
getAccountByType() method, user accounts, 428
getActualDefaultRingtoneUri() method, 209
getAddressLine() method, geocoding, 258
getAllocationByteCount() method, bitmaps, 314
getAllProviders() method, device location, 254
getApiClient() method, Google Play game services, 297
getAuthToken() method, user accounts, 428
getAvailableLocales() method, Locale class, 444
getBestProvider() method, device location, 254–255
getBondedDevices() method, Bluetooth, 237
getCallState() method, 212–213
getClipData() method, drag-and-drop, 134
getConfiguredNetworks() method, WifiManager, 248
getDefault() method
Locale class, 444
SmsManager, 218
getDefaultAdapter() method, Bluetooth, 236–237
getDefaultSensor(), 227
getDesiredMinimumHeight() method, wallpaper, 199
getDesiredMinimumWidth() method, wallpaper, 199
getDeviceList() method, USB host, 241
getDrawable() method, wallpaper, 199
getFragmentManager() method, Google Maps, 265–266
getFromLocation() method, geocoding, 257
getFromLocationName() method, geocoding, 259
getHeight() method, Canvas, 307
getHolder() method, SurfaceView, 348
getLocality() method, geocoding, 257
getMap() method, Google Maps, 265–266
getMaxAddressLineIndex() method, geocoding, 258
GetMethodID() function, native code exceptions, 383
getNumberOfCameras() method, 200
getOrientation() method, 230
getRoaming() method, 214
getScaleFactor() method, multitouch gestures, 132
getScanResults() method, Wi-Fi state, 247
getSettings() method, WebView, 178
getString() method, Cursor, 42
getSupportFragmentManager() method, Google Maps, 265–266
getSystemService() method
copying/pasting data, 119
determining device location, 254
NotificationManager, 79
retrieving Android network status, 172
USB accessories, 240
working as USB host, 241
getTextBounds() method, measuring screen, 312
getType() method, content providers, 61–62
getWidth() method, Canvas, 307
GitHub account, PayPal billing APIs, 280
GL (Graphics Library), 345
GL_COLOR_ARRAY, vertices, 355–356
GL_COLOR_MATERIAL, lighting scenes, 358–360
glColorPointer() method, vertices, 355–356
glCompileShader() method, OpenGL ES 2.0, 372
GLDebugHelper class, GLS, 351–352
glDrawArrays() method, vertices, 353–355
glDrawElements() method
GL_LINE_LOOP, drawing 3D objects, 357
Global Positioning System (GPS), 21–25, 254
Global searches, enabling, 424–425
glRotatef() method, drawing 3D objects, 353
glShaderSource() method, OpenGL ES 2.0, 372
GL_TEXTURE_COORD_ARRAY state, 3D objects, 361–362
gluLookAt() method, drawing 3D objects, 353
gluPerspective() method, OpenGL ES, 352
glUseProgram() method, OpenGL ES 2.0, 372
GLUT (OpenGL Utility Toolkit), 352
GLUtils.texImage2D() method, 3D objects, 361–362
GL_VERTEX_ARRAY state, drawing vertices, 355
glVertexPointer() method, drawing vertices, 353–355
Gmail, Google Cloud Messaging service, 272
gms.common.api package, Google Play game services, 296–297
GNU Awk, Android NDK, 378
GNU Make 3.81, Android NDK, 378
go() method, scene state transitions, 342
Google account, creating, 272, 283–285
adding library to Android IDE project, 286–287
collecting data, 287
creating Google account, 283–285
gathering e-commerce data, 290–292
logging different events, 287
overview of, 283
protecting user privacy, 293
tracking ad/market referrals, 292
Google Analytics Dashboard, 288–290
GoogleApiClient object, 297
Google APIs for Android
in-app billing. See In-app billing APIs
enabling application statistics. See Google Analytics
GCM. See GCM (Google Cloud Messaging)
location and maps. See Location and map APIs
Google Cast SDK, 209
Google Cloud Messaging. See GCM (Google Cloud Messaging)
Google Developer Console, 263, 273
Google location services APIs, 260–262
creating long-lasting/shareable debug key, 264–265
launching with location URI, 263–265
overview of, 262
positioning/animating map camera, 266–268
Google Play
adding services library to Android IDE project, 286–287
Android location APIs on devices without, 253
in-app billing APIs, 279
applications for tablets, 155
campaign tracking, 292
GCM for Android, 272
Google location services APIs, 260–262
publishing applications for foreign users, 446
publishing native Google TV apps, 157
translation services, 445
Google Play Developer Console, 295–296, 446
incorporating into applications, 296–297
leaderboards, 298
multiplayer gaming, 299
overview of, 295
quota and rate limiting, 298
saving game data, 299
google-play-services_lib project, 286
Google Wallet, 446
GPS (Global Positioning System), 21–25, 254
GpsSatellite class, 260
GpsStatus class, 260
GpsStatus.Listener class, 260
GPXService class, 20–21, 26–28
Gradle build system, Android Studio, 512–513
Graphical Layout editor, styles, 111
Graphics
alternative resources for, 153
Android NDK. See Android NDK (Native Development Kit)
animation. See Animation
designing layouts with WebView, 176
designing UI with stretchable, 152
L Developer Preview optimization, 460–461
using space on big landscape screens, 153–154
Graphics, 2D applications
hardware acceleration features, 324–326
overview of, 305
cleaning up OpenGL ES, 365–366
drawing more complex objects, 356–358
interacting with Android views/events, 362–365
OpenGL ES, APIs in Android SDK, 347
OpenGL ES, handling tasks, 347–353
OpenGL ES, working manually, 345–347
Graphics Library (GL), 345
GridView control, contextual action, 105
Haptic feedback, accessibility, 140
Hardware
2D acceleration features, 324–326
checking for Bluetooth, 236–237
limitations of TV application, 465
optional multimedia device, 191
hardwareAccelerated attribute, 325
Bluetooth. See Bluetooth
acquiring reference to, 227
batching calls, 230
configuring Android manifest file for, 227
determining device orientation, 230
finding true north, 230
interacting with device hardware, guidelines, 225–226
using device, 226
working with different, 226–227
Heads-up notifications, L Developer Preview, 463
hello-jni native library, Android NDK, 379
HelloStudio module, Android Studio, 510–512
help command, ACB, 470
Helper methods, WifiManager, 247–248
hint attribute, basic search, 417
historian.par (Battery Historian), Project Volta, 461
Home screen
accessing App Widget on, 393
changing language settings, 442
Google Analytics Dashboard reports, 288
installing App Widget to, 394, 400–401
installing live wallpaper on, 407–408
Host
working as USB, 241
Host card emulation applications, Android Beam, 245
HTTP
transferring data to and from network, 164–166
Icons
creating simple text notification, 79–80
displaying on notification queue, 80–82
expandable notifications, 89–90
handling application icon clicks on action bar, 103–104
as notification component, 79
updating notifications, 83
IDE (integrated development environment). See Android Studio
Identifiers
deleting SQLite database records, 39–40
Images
camera. See Still images
displaying from network resource, 170–171
storing in database, 53
ImageSwitcher, 171
ImageView background, animation, 330–331, 334
IMEs (Input Method Editors), 115, 117
Import statement, conventions used in this book, 7
Importing, database/data with sqlite3, 489
Amazon Appstore for Android, 280
antipiracy tips, 453
Google Play, 279
other, 280
PayPal, 280
includeInGlobalSearch attribute, global searches, 425
Index arrays, drawing 3D objects, 356–358
Indicator lights, notifications, 84–85
Indices of table, listing with sqlite3, 487
inflate() method, themes, 112
Initialization
OpenGL ES, 352
initialLayout attribute, App Widgets, 394
Input
Android applications leveraging speech, 139
methods. See User input methods
Input Method Editors (IMEs), 115, 117
InputStream
connections between Bluetooth devices, 238
displaying images from network resource, 171
reading data from Web, 165
inputType attribute values, software keyboard, 116–117
insert() method
adding data to content provider, 59
records in SQLite database, 38
insertImage() method, sharing images, 198
insertOrThrow() method, SQLite database records, 38
Installation
Android NDK, 378
Android Studio, 507
App Widget to Home screen, 394, 400–401
Lock screen App Widget, 403
using ADB, 473
install command, ADB, 473
Integrated Raster Imaging System Graphics Library (IRIS GL), 345
IntelliJ IDEA, Android Studio based on, 507
Intent action namespace, 67
Intent object
application acting as content filter, 410–413
controlling Service, 25
global searches, 425
implementing remote interface, 26–28
launching browser, 176
launching Google Maps, 263
as notification component, 79
receiving phone calls, 221–222
searching for multimedia, 207–208
textual input, 119
overview of, 67
quiz Q & A, 74
securing application broadcasts, 73–74
Interacting with Android views/events, 3D graphics, 362–365
Interface. See User interface
Internationalizing applications
alternative resources for, 439–442
locale support programmatically, 444–445
localizing language, 439
publishing applications for foreign users, 446
right-to-left language localization, 445
translation services via Google Play, 445
INTERNET permission, playing video, 202
Internet, transferring data, 164–166
Interoperability, Android application, 391
Interpolators, 341
IntEvaluator class, property animation, 337
Introduction to this book
contacting authors, 8
conventions used, 7
development environments used, 5–6
supplementary materials, 6
where to find more information, 6–7
who should read it, 1
invalidate() method, gestures, 127, 131
IN_VEHICLE, activity recognition APIs, 261
IRIS GL (Integrated Raster Imaging System Graphics Library), 345
isAfterLast() method, Cursor, 41–42
isDiscovering() method, Bluetooth devices, 238
isEmergencyNumber() method, PhoneNumberUtils, 215
isHardwareAccelerated() method, View control, 326
IS_RINGTONE flag, 207
isVideoSnapshotSupported() method, 201
Iterating query results, with Cursor, 41–42
Java
calling native code from, 377–378, 380–381
supporting Open GL ES 2.0 with Android, 369–373
susceptible to reverse engineering, 450
Java, for Android developers
familiarity with Java documentation, 500
learning Java development tools, 499–500
learning Java programming language, 499
understanding Java shorthand, 500–504
Javadocs, 500
JavaScriptExtensions class, 184
@JavascriptInterface annotation, warning, 184
javaThrowsException() method, native code, 383
JIT (just-in-time) compilation, ART runtime, 460
JNI bindings, debugging, 460
JNIEnv object, native code, 382–383
/jni subdirectory, NDK project, 379–380
JobScheduler API, Project Volta, 461
Jobs, Steve, 98
jse.javaMethod(), web extensions, 184
Keyboards. See Software keyboards
Keyboard shortcuts, Android Studio, 517
Key handling, GLSurfaceView, 368
Keymap quick reference card, Android Studio, 517
keytool command-line tool, debug key, 264–265
Killing services, 20
kill-server command, ADB server, 470
label attribute, basic searches, 417
Language & input settings, 442
Languages
international. See Internationalizing applications
speech recognition services, 146
Latency, controlling network, 173
Latitude
geocoding locations, 256, 258–260
geofencing APIs, 262
launching Google Maps, 263
Launching Android Studio, 508
launchRecognizer value, voice search, 420
launchWebSearch value, voice search, 420
Layout
creating App Widget, 394
designing devices with flexible, 152
designing with WebView control, 176
internationalization via alternative resources, 440–442
right-to-left language localization, 445
using RemoteViews, 397
using space on big landscape screens, 153–154
web extensions, 183
Layout Editor, Android Studio, 513–515
LBS (location-based services), 145
L Developer Preview, or Android L
improving performance, 460–461
improving user experience, 461–464
setting up SDK, 459
Leaderboards, Google Play game services, 298
Library services, Google Analytics SDK for Android, 286–287
/libs folders, Android Studio, 512
License Verification Library (LVL), 452–453
Lifecycle
broadcast receiver, 69
Cursor objects, 41
Service, 20
Service vs. Activity, 21
Lighting scenes, OpenGL ES, 358–359
Linear gradients, 308
LinearInterpolator, animation, 341
lint tool, accessibility issues, 141
listen() method, TelephonyManager, 213, 214–215
Listeners, using inner classes, 504
Listening
for events on entire screen, 120–121
for touch mode changes, 119–120
LISTEN_SERVICE_STATE flag, 213
ListView control
binding data to controls, 50–53
contextual action mode, 105
retrieving content provider data, 64
Live wallpapers
overview of, 404
loadAndCompileShader() method, OpenGL ES 2.0, 371–372
loadData() method, WebView, 177
LoaderManager, 16
loadInBackground() method, search Activity, 423
Loading animations, 334
Loading images, 314
loadUrl() method, WebChromeClient, 179
LocalBroadcastManager class, 74
Locale
changing language settings, 442–444
implementing programmatically, 444–445
internationalization via alternative resources, 439–442
Localizing application language
changing language settings, 442–444
implementing programmatically, 444–445
overview of, 439
right-to-left, 445
using alternative resources, 439–442
Android location APIs. See Android location APIs
Google location services APIs, 260–262
Google Maps Android API v2, 262–268
Location-based services (LBS), 145
Location class, Parcelable interface, 26
LocationListener object, 254–255
LOCATION_SERVICE, 254
Location URI, launching Google Maps with, 263
Lock, for file backups, 433
Lock screen
L Developer Preview improvements, 463
logcat command, 474
Logging
e-commerce events in Google Analytics, 290–291
events in Google Analytics, 287
Long-click event, listening for, 121–122
Long-form dictation, SpeechRecognizer, 141
Longitude
geocoding locations, 256, 258–260
geofencing APIs, 262
launching Google Maps with location URI, 263
3.12.150.250