Index

Symbols

* (asterisk), filtering log information, 475

. (dot), sqlite3 commands, 486

; (semicolon), sqlite3, 490

A

AbstractAccountAuthenticator class, 428

AbstractThreadedSyncAdapter class, 429

AccelerateDecelerateInterpolator, 341

AccelerateInterpolator, 341

ACCESS_COARSE_LOCATION permission, 212

Access control, SQLite limitations, 491

Access points, listing, 248

Accessible applications

framework, 139141

overview of, 139

quiz Q & A, 148, 520

speech recognition services, 141145

testing, 147

text-to-speech services, 145147

Accessories

new Android hardware, 239240

USB, 240242

Account authenticator, 428

Account provider, 428

AccountManager class, 427429

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, 297298

Action bars

building basic, 98101

contextual action mode, 105106

customizing, 101103

handling application icon clicks on, 103104

overview of, 9899

working with screens not requiring, 104105

ActionMode class, 104

ACTION_RECOGNIZE_SPEECH, 145

ACTION_REQUEST_DISCOVERABLE intent, Bluetooth, 237

ACTION_REQUEST_ENABLE intent, Bluetooth, 237

ActionScript 3, 188

ACTION_SEARCH, 422423

ACTION_VIEW intent, Google Maps, 263

Activity class

application acting as content filter, 410412

asynchronously loading data, 16

AsyncTask, 1314

building action bars, 98101

configuring default messaging, 217

creating App Widget, 393

creating search, 422423

data for Google Analytics, 287

gathering statistics, 292

GLSurfaceView, 366369

IntentService class, 3133

launching browser, 176

native activities, 384

OpenGL/application threads, 362364

removing action bars, 104105

software keyboards, 116

themes, 111113

Thread class, 1516

Activity launch, 341, 422

Activity lifecycle

AsyncTask class, 1214

spanning processing across, 19

text notifications, 80

ActivityOptions class, 341

Activity recognition APIs, Google location services, 261262

<activity> tag

application acting as content filter, 411

enabling application search, 424

hardware acceleration control, 325

registering intent filter, 413

themes, 111

ADB (Android Debug Bridge)

accessing sqlite3 from, 486

backup service controls, 476477

copying files, 472

directing commands to specific devices, 470

generating bug reports, 477478

inspecting SQLite databases with shell, 478

installing custom binaries, 481482

installing/uninstalling applications, 473

issuing shell commands, 471472

listing all commands, 470471

listing connected devices/emulators, 469

with LogCat logging, 474476

overview of, 469

quiz Q & A, 482, 526

starting ADB server, 470

stopping ADB server, 470

stress testing applications with shell, 478481

addGlobalLayoutListener() method, 121

addHelper() method, 432434

addJavascriptInterface() method, 183, 187

addOnDrawListener() method, 121

addOnPreDrawListener() method, 120

addOnTouchModeChangeListener() method, 120

addURI() method, 419

ADK (Android Accessory Development Kit), 139, 239240

Admin permissions, Bluetooth, 235, 237238

Admin section, Google Analytics, 284285

Adobe Air, 187188

Adobe Flash, 187188

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), 2628

AIR, Adobe, 187188

AlarmManager class, App Widgets, 396

Alarms, system event, 208

Alerts, proximity, 260

All Apps button, language settings, 442

Alpha transparency transformations, 334335

ALTER TABLE, SQLite limitations, 491

Alternative resources

changing language settings, 442444

device diversity, 153

internationalization, 439442

Amazon Appstore for Android, 280

Android 4.4 (KitKat), 6, 508

Android Accessory Development Kit (ADK), 139, 239240

Android Backup Service, 430435

Android Beam

configuring manifest file, 244245

enabling sending, 241243

host card emulation, 245

over Bluetooth, 245

overview of, 241

receiving messages, 243244

Android Debug Bridge. See ADB (Android Debug Bridge)

Android Developers Blog, 117

Android Development Tools (ADT), 111, 500

Android IDE, 499500

Android Interface Definition Language (AIDL), 2628

Android location APIs

doing more, 260

geocoding locations, 256260

GPS, 254256

overview of, 253

Android NDK (Native Development Kit)

drawbacks, 377378

improving graphics performance, 384385

installing, 378

leveraging OpenGL ES, 346

quiz Q & A, 386, 524

RenderScript vs., 385386

sample application, 379

when to use, 377378

Android NDK (Native Development Kit), creating project

calling native code from Java, 380381

overview of, 379380

parameters and return values, 381382

using exceptions with native code, 382383

using native activities, 384

Android Runtime (ART), L Developer Preview, 460461

Android SDK

configuring Android Studio, 508509

getting familiar with Java documentation, 500

License Agreement, 174

OpenGL ES APIs in, 347

OpenGL ES in Android, 346

using Android NDK vs., 377378

versions of OpenGL ES, 346

Android Studio

configuring, 508509

creating project, 509512

debugging applications, 515517

getting up and running, 507508

Gradle build system, 513

keyboard shortcuts, 517

launching for first time, 508

Layout Editor, 513515

learning Java development tools, 500

overview of, 507

project structure, 512

quiz Q & A, 517518, 526

user interface, 513514

Android TV, 464465

Android Wear API, 158159

android.accounts package, 427429

android.animation package, 339

android.database.sqlite package, 36

AndroidManifest.xml file

building content provider, 62

configuring Android Beam, 244245

configuring App Widgets, 399

configuring live wallpapers, 406407

configuring search, 423424

creating Service, 20

enabling vibration with notifications, 84

permissions, 25

registering backup agent, 434

securing application broadcasts, 74

working with themes, 111113

android.permission.INTERNET permission, 175176

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, 182187

animate() method, property animations, 339340

animateCamera() method, 267

Animation

Activity launch, 341

drawable, 329331

GIF images, 329331

in L Developer Preview, 462463

property, 336341

quiz Q & A, 342343, 524

scenes and transitions for state, 342

types of graphic, 329

view, 331336

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, 1112

Anti-aliasing, Paint, 307

AnticipateInterpolator, 341

AnticipateOvershootInterpolator, 341

Antipiracy. See also Software piracy protection, 299300

AOT (ahead-of-time) compilation, ART runtime, 460

API Access link, maps, 263

APIs, Android

Android Wear, 158159

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, 1112

Applications

App Widgets tied to underlying, 392

content providers for, 6265

gathering statistics. See Google Analytics

gathering statistics from, 292

handling icon clicks on action bar, 103104

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, 395397

<appwidget-provider> tag, 394, 402

App Widgets

adding to Lock screen, 401403

becoming host, 401

calculating size of, 394

configuring Android manifest file for, 399

creating, 393396

defined, 392

installing to Home screen, 400401

updating, 397399

using remote views, 396397

working with, 392393

Archived data, wiping, 477

Arcs, drawing, 320322

ArgbEvaluator class, property animation, 337

ARMv5TE devices, Android NDK, 379380

ArrayAdapter, binding data to controls, 53

Arrays, drawing vertices, 353355

ART (Android Runtime), L Developer Preview, 460461

Asterisk (*), filtering log information, 475

Asynchronous network operations, 167169, 260

AsyncTask class, 1214, 168, 314

Attributes, property animation, 338

Audiences

attracting new types of device, 153

for this book, 1

Audio

playing, 205206

recording, 204205

ringtones, 208209

sharing, 206207

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

B

Background processing

AsyncTask, 1214

Service, 1920, 2224

Backup agent, 431434

Backup helper, 431432

Backup Manager, 434435, 476477

Backup service

choosing remote, 430431

controlling using ADB command, 476477

forcing backup operations, 477

forcing restore operations, 477

implementing backup agent, 432435

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, 296297

BasicGLThread class, OpenGL ES, 349350

basicNativeCall() method, 381

Battery

monitoring use of, 231233

optimization in Project Volta, 461

beginTransaction() method, SQLite database transactions, 40

Bidi Formatter utility class, 445

BigPictureStyle class, notifications, 8890

bigText() method, notifications, 8890

BigTextStyle class, notifications, 8890

Binding data, to application user interface, 4853

bindService() method, 2021, 27

Bitmap graphics

2D applications, 312315

buffering issues of large, 170

drawable animation, 330331

drawing on Canvas, 313

performance optimizations, 314315

scaling, 313

texturing 3D objects, 361362

transforming using Matrix, 313314

working with, 312

working with view animations, 331332

BLE (Bluetooth Low Energy) peripheral devices, 235236

Blinking lights, notifications, 8485

Blocking operations, 11

Bluetooth

Android Beam over, 245

Android support for, 235236

checking hardware for, 236237

discovering devices, 237238

enabling, 237

establishing connections between devices, 238239

querying for paired devices, 237

quiz Q & A, 248, 522

BluetoothAdapter class, 236238

BLUETOOTH_ADMIN permission, 235, 237238

Bluetooth Low Energy (BLE) peripheral devices, 235236

BLUETOOTH permission, 235

BluetoothSocket object, 238

Body text, notifications, 79

BounceInterpolator, animation, 341

Breakpoints, debugging Android Studio applications, 515516

BroadcastIntent class, 3132, 207, 231

BroadcastReceiver class

default messaging application, 217

GSM message flow, 272

monitoring device battery, 231233

monitoring Wi-Fi state, 247

receiving broadcasts, 6971

Broadcasts

overview of, 67

quiz Q & A, 74, 520

receiving, 6974

securing application, 7374

sending, 6768

Browser chrome, WebView control, 179180

Buffering issues, large bitmaps, 170

Buffers

coloring vertices, 355356

converting arrays to, 354355

drawing complex 3D, 356358

texture coordinate, 361362

build() method

animating map camera, 267

creating text notification with icon, 80

Builder classes, 290291, 501

Built-in functions, SQLite limitations, 491

Button control

applying styles, 108

IntentService, 3133

listening for long click on, 122

recording speech, 145

web extensions, 183, 185

ByteBuffer, drawing 3D objects, 356358

C

C2DM (Cloud to Device Messaging), 271

CacheManager class, WebKit API, 182

calculateAndDisplayFPS() method, OpenGL, 362364

Calculated columns, SQLite database, 496497

calculateSignalLevel() method, WifiManager, 247248

Calibration, sensor, 229230

Call button, phone calls, 220221

Calls class, 221222

CallVoidMethod() function, exceptions with native code, 383

Camera, positioning and animating map, 266268

Camera class

assigning still images as wallpaper, 199

capturing still images, 192196

choosing among devices, 199200

common parameters, 197

configuring settings, 196

face detection, 203204

sharing images, 198

working with multimedia, 191192

zooming, 197

CameraPosition object, 267

CameraSurfaceView class, 192196

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, 305309

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

Chess Utrecht font, 311312

Chrome DevTools, debugging WebView, 187

Chromium rendering engine, WebView, 175

Circles, drawing, 319320

Classes, Java

documentation, 500

method chaining in builder-style, 501

working with inner, 503504

Classic Bluetooth. See also Bluetooth, 235236

cleanupgl() method, OpenGL ES, 366

clear() method, wallpaper, 199

Clearing log, 476

Click events, long click, 121122

Client, integrating GCM on Android, 273274

Clipboard framework, textual input, 118119

ClipboardManager, 119

ClipData object, 119, 134

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

ProGuard, 450452

secure practices, 450

Color

3D objects, 355356, 358360

building simple styles, 107109

Google TV, 157

indicator lights for notifications, 8485

L Developer Preview, 462

Paint, 307309

Columns

building content provider, 5657

data types for SQLite database, 492

raw queries, 45

SQLite database calculated, 496497

compare() method, PhoneNumberUtils, 215

compareSignalLevel() method, WifiManager, 247248

Compatibility

development environments, 6

notifications and, 7879

OpenGL ES device, 346347

Complex queries, 4344

Composite primary keys, SQLite database tables, 493494

Concurrency, SQLite limitations, 490

CONFIG_CHECK_GL_ERROR flag, initializing GLS, 351

Configuration Activity, App Widgets, 395

Connections

between Bluetooth devices, 238239

buffering of large bitmaps over slow, 170

fused location provider, 261

geocoding requiring network, 260

implementing remote interface, 27

retrieving Android network status, 171173

to Service, 2021

to SQLite database, 486487

ConnectivityManager class, 171173

ConsoleMessage class, WebKit API, 182

Constants, Sensor class, 227

Content

loading into WebView, 176178

selling through billing APIs, 278

web extensions, 183

Content providers

acting as, 55

data columns, 5657

data URI, 56

delete() method, 6061

enhancing applications, 6265

getType() method, 6162

insert() method, 59

interface, 5556

query() method, 5758

quiz Q & A, 65, 519

searches in applications, 417420

sharing images, 198

SQLite database acting as, 485

update() method, 5960

updating manifest file, 62

UriMatcher class, 5859

UserDictionary, 118

ContentResolver

retrieving content provider data, 6465

sharing audio, 206

sharing images, 198

Content type filters, 410413

ContentValues object, update(), 3839

Context menu, long-click events, 121

Contextual action mode, action bars, 105106

Contractible notifications, 8890

Controls

for accessibility, 140

binding data to, 5053

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, 242243

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, 5053

content provider query(), 57

querying SQLite databases, 4142

retrieving content provider data, 64

Custom binaries, installing, 481482

CustomGL2SurfaceView class, OpenGL ES 2.0, 370

Customizing

action bar, 101103

backup services, 431

Home screen wallpaper, 192, 199

notifications, 8688

software keyboards, 117

typefaces, 310312

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

D

Dalvik Debug Monitor Service. See DDMS (Dalvik Debug Monitor Service)

Data

adding to SQLite database, 492

altering/updating in SQLite database, 495

backup services, 430435

binding to application user interface, 4853

building content provider, 5657

collecting for Google Analytics, 287

gathering statistical, 292293

Google Analytics tracking e-commerce, 290292

reading sensor, 228229

retrieving content provider, 6465

synchronizing, 429430

Data adapters, 5053

dataChanged() method, backups, 434

Data sources, 16

Data types, 492

DateFormat utility class, localizing language, 445

Daydream (screen saver), 408410

DDMS (Dalvik Debug Monitor Service)

dumping database contents, 489

inspecting database files, 485

simulating call states, 213

deactivate() method, Cursor, 41

Debug certificate, 263265

Debugging

with ADB. See ADB (Android Debug Bridge)

Android NDK applications, 379

Android Studio applications, 515517

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, 215216

delete() method, content provider, 6061

deleteDatabase() method, SQLite, 46

Design

accessibility. See Accessible applications

useful notifications, 9192

user interface. See User interface

Design view, Android Studio, 514

Development environments, used in this book, 56

Devices

attracting new types of users, 153

copying files to, 472

determining locale of, 444

determining location of, 254256

directing ADB commands to specific, 470

disallowing sqlite3, 487

flexible user interfaces for, 152

indicator light support, 8485

input methods, 115

installing custom binaries, 481482

listing all Android connected, 469

live wallpaper warning, 406

notification support, 78

OpenGL ES compatibility with, 346347

presumptions about features, 151152

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, 107109

disable() method, screen orientation, 136

Discovering devices, Bluetooth, 237238

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, 185186

Dot (.), sqlite3 commands, 486

doToast() function, web extensions, 185

Double-tap gestures, 124125, 128129

DragAndDropDemo.java, 134

Drag-and-drop framework, 134

Dragging, single-touch gesture, 124

DragShadowBuilder class, 134

draw() method, coloring vertices, 355356

Drawable animations, 329331

Drawable object, 171

Drawable resources, L Developer Preview, 462

drawFrame() method, 366367, 372, 384385

Drawing 2D objects

with canvases and paint, 305308

overview of, 305

with radial gradients, 309

with sweep gradients, 309

with text, 310312

Drawing 3D objects

coloring vertices, 355356

complex objects, 356358

defined, 345

lighting scene, 358359

setting up screen, 353354

texturing objects, 359362

vertices, 353355

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

E-commerce overview reports, Google Analytics, 290292

EditText control

basic searches, 417

building styles, 106109

choosing software keyboard, 116117

listening for focus changes, 122123

making phone calls, 220221

speech recognition, 141

working with phone numbers, 215

EGL (Embedded-System Graphics Library), 345, 350352

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, 350352

Emulators

allowing sqlite3 command, 487

copying files to, 472

installing custom binaries, 481482

locating your, 256

network settings, 173

nonsupport for simulating hardware sensors, 225

retrieving files from, 472

using ADB shell to start/stop, 471472

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

WebView control, 179180

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, 362365

listening for focus changes, 122123

listening for long clicks, 121122

listening for on entire screen, 120121

listening for touch mode changes, 119120

live wallpaper responding to user, 406

logging e-commerce, in Google Analytics, 290291

logging in Google Analytics, 287

stress testing applications with monkey, 478481

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

execute() method

executing tasks in parallel, 14

launching AsyncTask, 1314

parallel execute, 14

executeOnExecutor() method, parallel execute, 14

Exerciser Monkey tool, ADB shell, 478481

Expandable notifications, 8890

exported attribute, <intent-filter> tag, 74

Exporting, database/data with sqlite3, 488

Extending Android application reach

acting as content type handler, 410411

with App Widgets. See App Widgets

with Daydream, 408410

determining Intent actions/MIME types, 411413

with live wallpapers, 404408

overview of, 391392

quiz Q & A, 413414, 524525

extensions, building web, 182187

Extract as Style, styles, 111

EXTRA_LANGUAGE_MODEL, RecognizerIntent, 145

EXTRA_PROMPT, RecognizerIntent, 145

F

Face class, Camera, 203204

Face detection, 203204

Features

adding to WebView, 176178

antipiracy tips, 453

avoiding presumptions about device, 151154

specifying multimedia, 191192

Field names, tracking database, 47

FileBackupHelper class, 432434

File Explorer, 485, 489

FileLock, backup helper, 434

File pointers, Cursor objects as, 4142

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, 474475

findViewById() method, web extensions, 183

Finger gestures. See Gestures

Fingerprint, map API key, 263264

Flash

optimizing for Google TV, 157

working with, 187188

Flickr image, displaying, 170171

Fling gestures, 124125, 128

FloatBuffer() method, drawing vertices, 354355

FloatEvaluator class, property animation, 337

Folders, Android Studio projects, 512

Fonts

conventions used in this book, 7

customizing typefaces, 310312

enabling accessibility, 140

modifying WebView control, 178

using default, 310

for-each loops, looping infinitely, 502

Foreground, designing notifications, 91

Foreign keys, SQLite database, 3738, 493494

for loops, looping infinitely, 501502

format() method, locale strings, 445

formatJapaneseNumber() method, phone numbers, 215

formatNumber() method, phone numbers, 215216

Fragment

asynchronously loading data to, 16

gathering statistics, 292

launching Google Maps, 265266

for tablets, 155

for user interfaces, 152

Frame-by-frame animations, 329331

Frame rate, OpenGL/application threads, 363364

FrameLayout, 349

Freemium business model, 277279

fromAlpha value, alpha transparency transformations, 334335

fromDegrees property, transformations, 335

fromXDelta, fromYDelta values, transformations, 336

fromXScale, fromYScale values, transformations, 335336

Front-facing camera, 199200

FTS3 extension, SQLite, 420

Functions, Service for routine/regular, 19

Fused location provider, Google location services, 260261

G

GameHelper class, Google Play game services, 296297

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

GCM (Google Cloud Messaging)

alternatives to, 274275

incorporating into applications, 273274

limitations of, 272273

message flow, 272

overview of, 271272

quiz Q & A, 275, 522

sample applications, 274

signing up for, 273

Geocaching, 260

Geocoding, 256260

Geofencing APIs, 262

GeomagneticField class, true north, 230

gesture package, 124

GestureDetector class, 123129

GestureListener class, 129, 132

GestureOverlayView, 124

Gestures

common multitouch, 133

common single-touch, 124129

detecting user motions within View, 123124

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, 254255

getBondedDevices() method, Bluetooth, 237

getCallState() method, 212213

getClipData() method, drag-and-drop, 134

getConfiguredNetworks() method, WifiManager, 248

getDefault() method

Locale class, 444

SmsManager, 218

getDefaultAdapter() method, Bluetooth, 236237

getDefaultSensor(), 227

getDesiredMinimumHeight() method, wallpaper, 199

getDesiredMinimumWidth() method, wallpaper, 199

getDeviceList() method, USB host, 241

getDrawable() method, wallpaper, 199

getFragmentManager() method, Google Maps, 265266

getFromLocation() method, geocoding, 257

getFromLocationName() method, geocoding, 259

getHeight() method, Canvas, 307

getHolder() method, SurfaceView, 348

getLocality() method, geocoding, 257

getMap() method, Google Maps, 265266

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, 265266

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, 6162

getWidth() method, Canvas, 307

GitHub account, PayPal billing APIs, 280

GL (Graphics Library), 345

GL_COLOR_ARRAY, vertices, 355356

GL_COLOR_MATERIAL, lighting scenes, 358360

glColorPointer() method, vertices, 355356

glCompileShader() method, OpenGL ES 2.0, 372

GLDebugHelper class, GLS, 351352

glDrawArrays() method, vertices, 353355

glDrawElements() method

complex 3D objects, 356357

vertices, 353355

GL_LINE_LOOP, drawing 3D objects, 357

Global Positioning System (GPS), 2125, 254

Global searches, enabling, 424425

glRotatef() method, drawing 3D objects, 353

glShaderSource() method, OpenGL ES 2.0, 372

GLSurfaceView, 347, 366369

GL_TEXTURE_COORD_ARRAY state, 3D objects, 361362

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, 361362

GL_VERTEX_ARRAY state, drawing vertices, 355

glVertexPointer() method, drawing vertices, 353355

Gmail, Google Cloud Messaging service, 272

gms.common.api package, Google Play game services, 296297

GNU Awk, Android NDK, 378

GNU Make 3.81, Android NDK, 378

go() method, scene state transitions, 342

Google account, creating, 272, 283285

Google Analytics

adding library to Android IDE project, 286287

Admin section, 284285

collecting data, 287

creating Google account, 283285

gathering e-commerce data, 290292

gathering statistics, 292293

logging different events, 287

overview of, 283

protecting user privacy, 293

quiz Q & A, 293294, 523

Reporting section, 284285

tracking ad/market referrals, 292

Google Analytics Dashboard, 288290

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, 260262

Google Maps Android API v2

creating long-lasting/shareable debug key, 264265

launching with location URI, 263265

mapping fragments, 265266

marking spot, 265266

overview of, 262

positioning/animating map camera, 266268

Google Play

adding services library to Android IDE project, 286287

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, 260262

publishing applications for foreign users, 446

publishing native Google TV apps, 157

translation services, 445

Google Play Developer Console, 295296, 446

Google Play game services

achievements, 297298

antipiracy, 299300

getting started, 295296

incorporating into applications, 296297

leaderboards, 298

multiplayer gaming, 299

overview of, 295

quiz Q & A, 300, 523

quota and rate limiting, 298

saving game data, 299

google-play-services_lib project, 286

Google TV, 155158

Google Wallet, 446

GPS (Global Positioning System), 2125, 254

GpsSatellite class, 260

GpsStatus class, 260

GpsStatus.Listener class, 260

GPXService class, 2021, 2628

Gradients, Paint, 307309

Gradle build system, Android Studio, 512513

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, 460461

using space on big landscape screens, 153154

Graphics, 2D applications

drawing on screen, 305309

hardware acceleration features, 324326

overview of, 305

quiz Q & A, 326, 523

working with bitmaps, 312315

working with shapes, 315324

working with text, 310312

Graphics, 3D applications

cleaning up OpenGL ES, 365366

coloring vertices, 355356

drawing more complex objects, 356358

drawing vertices, 353355

interacting with Android views/events, 362365

lighting scene, 358360

live wallpapers, 404408

OpenGL ES 2.0, 369373

OpenGL ES 3.0, 373374

OpenGL ES, APIs in Android SDK, 347

OpenGL ES, handling tasks, 347353

OpenGL ES, working manually, 345347

quiz Q & A, 374, 524

texturing objects, 359362

using GLSurfaceView, 366369

Graphics Library (GL), 345

GridView control, contextual action, 105

H

Haptic feedback, accessibility, 140

Hardware

2D acceleration features, 324326

checking for Bluetooth, 236237

limitations of TV application, 465

optional multimedia device, 191

hardwareAccelerated attribute, 325

Hardware APIs

Android Beam, 241245

Bluetooth. See Bluetooth

quiz Q & A, 248249, 522

USB, 239241

Wi-Fi, 245248

Hardware sensors

acquiring reference to, 227

batching calls, 230

calibrating, 229230

configuring Android manifest file for, 227

determining device orientation, 230

finding true north, 230

interacting with device hardware, guidelines, 225226

monitoring battery, 231233

quiz Q & A, 233, 522

reading data, 228229

using device, 226

working with different, 226227

Heads-up notifications, L Developer Preview, 463

hello-jni native library, Android NDK, 379

HelloStudio module, Android Studio, 510512

help command, ACB, 470

Helper methods, WifiManager, 247248

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, 400401

installing live wallpaper on, 407408

Host

App Widget, 392, 401

working as USB, 241

Host card emulation applications, Android Beam, 245

HTTP

GCM for Android, 272, 274

transferring data to and from network, 164166

HttpURLConnection, 165166

I

Icons

creating simple text notification, 7980

displaying on notification queue, 8082

expandable notifications, 8990

handling application icon clicks on action bar, 103104

as notification component, 79

updating notifications, 83

IDE (integrated development environment). See Android Studio

Identifiers

deleting SQLite database records, 3940

Notification, 8081

Images

camera. See Still images

displaying from network resource, 170171

storing in database, 53

ImageSwitcher, 171

ImageView background, animation, 330331, 334

IMEs (Input Method Editors), 115, 117

Import statement, conventions used in this book, 7

Importing, database/data with sqlite3, 489

In-app billing APIs

Amazon Appstore for Android, 280

antipiracy tips, 453

Google Play, 279

other, 280

PayPal, 280

quiz Q & A, 281, 523

understanding, 277278

using, 278279

includeInGlobalSearch attribute, global searches, 425

Index arrays, drawing 3D objects, 356358

Indicator lights, notifications, 8485

Indices of table, listing with sqlite3, 487

Infinite loops, Java, 501502

inflate() method, themes, 112

Inheritance, style, 109111

Initialization

GLS, 350352

OpenGL ES, 352

initialLayout attribute, App Widgets, 394

Inner classes, Java, 503504

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, 116117

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, 400401

of custom binaries, 481482

live wallpaper, 407408

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, 410413

clearing notifications, 8283

controlling Service, 25

global searches, 425

implementing remote interface, 2628

launching browser, 176

launching Google Maps, 263

making phone calls, 220221

as notification component, 79

receiving phone calls, 221222

recording speech, 142145

searching for multimedia, 207208

textual input, 119

Intent objects, broadcasts

overview of, 67

quiz Q & A, 74

receiving broadcasts, 6973

securing application broadcasts, 7374

sending broadcasts, 6768

IntentService class, 3033

Interacting with Android views/events, 3D graphics, 362365

Interface. See User interface

Internationalizing applications

alternative resources for, 439442

language settings, 442444

locale support programmatically, 444445

localizing language, 439

publishing applications for foreign users, 446

quiz Q & A, 446447, 525

right-to-left language localization, 445

translation services via Google Play, 445

INTERNET permission, playing video, 202

Internet, transferring data, 164166

Interoperability, Android application, 391

Interpolators, 341

IntEvaluator class, property animation, 337

Introduction to this book

changes in this edition, 45

contacting authors, 8

conventions used, 7

development environments used, 56

questions answered, 34

structure used, 13

supplementary materials, 6

where to find more information, 67

who should read it, 1

invalidate() method, gestures, 127, 131

IN_VEHICLE, activity recognition APIs, 261

IRemoteInterface, 2628

IRIS GL (Integrated Raster Imaging System Graphics Library), 345

isAfterLast() method, Cursor, 4142

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, 4142

J

Java

calling native code from, 377378, 380381

supporting Open GL ES 2.0 with Android, 369373

susceptible to reverse engineering, 450

Java, for Android developers

familiarity with Java documentation, 500

learning Java development tools, 499500

learning Java programming language, 499

quiz Q & A, 505, 526

understanding Java shorthand, 500504

Javadocs, 500

JavaScript, 178, 183187

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, 382383

/jni subdirectory, NDK project, 379380

JobScheduler API, Project Volta, 461

Jobs, Steve, 98

Joins, SQLite, 491, 495

jse.javaMethod(), web extensions, 184

K

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, 264265

Killing services, 20

kill-server command, ADB server, 470

KitKat (Android 4.4), 6, 508

L

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, 258260

geofencing APIs, 262

launching Google Maps, 263

Launching Android Studio, 508

launchRecognizer value, voice search, 420

launchWebSearch value, voice search, 420

Layout

applying styles, 106109

creating App Widget, 394

designing devices with flexible, 152

designing with WebView control, 176

internationalization via alternative resources, 440442

right-to-left language localization, 445

style inheritance, 109111

themes, 111113

using RemoteViews, 397

using space on big landscape screens, 153154

web extensions, 183

Layout Editor, Android Studio, 513515

LBS (location-based services), 145

L Developer Preview, or Android L

Android TV, 464465

improving performance, 460461

improving user experience, 461464

new APIs added to, 459460

quiz Q & A, 465, 526

setting up SDK, 459

Leaderboards, Google Play game services, 298

LEDs, notifications, 8485

Library services, Google Analytics SDK for Android, 286287

/libs folders, Android Studio, 512

License Verification Library (LVL), 452453

Lifecycle

Activity, 1214

broadcast receiver, 69

Cursor objects, 41

Service, 20

Service vs. Activity, 21

Lighting scenes, OpenGL ES, 358359

Linear gradients, 308

LinearInterpolator, animation, 341

lint tool, accessibility issues, 141

listen() method, TelephonyManager, 213, 214215

Listeners, using inner classes, 504

Listening

for events on entire screen, 120121

for long clicks, 121122

for touch mode changes, 119120

LISTEN_SERVICE_STATE flag, 213

ListView control

binding data to controls, 5053

contextual action mode, 105

retrieving content provider data, 64

Live wallpapers

configuring, 406407

creating, 404406

installing, 407408

overview of, 404

loadAndCompileShader() method, OpenGL ES 2.0, 371372

loadData() method, WebView, 177

Loader class, 12, 16

LoaderManager, 16

loadInBackground() method, search Activity, 423

Loading animations, 334

Loading content, 176178, 183

Loading images, 314

loadUrl() method, WebChromeClient, 179

LocalBroadcastManager class, 74

Locale

changing language settings, 442444

implementing programmatically, 444445

internationalization via alternative resources, 439442

Localizing application language

changing language settings, 442444

implementing programmatically, 444445

overview of, 439

right-to-left, 445

using alternative resources, 439442

Location and map APIs

Android location APIs. See Android location APIs

Google location services APIs, 260262

Google Maps Android API v2, 262268

GPS, 254256

quiz Q & A, 268269, 522

Location-based services (LBS), 145

Location class, Parcelable interface, 26

LocationListener object, 254255

LocationManager, 254255, 260

LOCATION_SERVICE, 254

Location URI, launching Google Maps with, 263

Lock, for file backups, 433

Lock screen

App Widgets, 393, 401403

L Developer Preview improvements, 463

logcat command, 474

LogCat utility, 473474

Logging

e-commerce events in Google Analytics, 290291

events in Google Analytics, 287

with LogCat utility, 474476

Long-click event, listening for, 121122

Long-form dictation, SpeechRecognizer, 141

Longitude

geocoding locations, 256, 258260

geofencing APIs, 262

launching Google Maps with location URI, 263

Looping infinitely, Java, 501502

LVL (License Verification Library), 452453

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.150.250