M

makeCustomAnimation() method, 341

makeScaleUpAnimation() method, 341

makeThumbnailScaleUpAnimation() method, 341

Map API key, 263265

Map APIs. See Google Maps Android API v2

MapFragment, 265266

mapping.txt, 452

Marker, Google Maps, 266267

Material design, L Developer Preview, 461463

Material theme, L Developer Preview, 462

Matrix class, transforming bitmaps, 313314

Measuring text screen requirements, 312

MediaController, 202203

MediaDrm class, 202

MediaPlayer object, 202203, 205206

MediaRecorder object, 200201, 204205

MediaRouteProvider APIs, 209

Media router APIs, 209

Media router library, multimedia APIs, 209

MediaScannerConnection class, 198

MEDIA_SEARCH, 207208

MediaStore content provider, 198, 206

Memory, bitmap optimization, 313314

MenuInflater, contextual action mode, 104

Message flow, Google Cloud Messaging, 272, 273274

Metadata, NotificationListenerService, 91

<meta-data> manifest tag

Android Backup Service, 431

App Widgets, 399

Google Cloud Save, 299

Google Maps Android, 265

search, 423424

Methods

building content provider, 5762

chaining in Java, 501

MIME types

application acting as content filter, 410413

building content provider, 6162

overview of, 411

minSdkVersion, action bars, 101

MMS (Multimedia Messaging Service), 216217

monkey application, 472, 478481

monospace font

conventions used in this book, 7

drawing on screen, 310

MotionEvent object, gesture detectors, 123

Mouse-overs, WebView control, 178

moveToFirst() method, Cursor, 4142

moveToNext() method, Cursor, 4142

Moving transformations, 336

mSaveText, listening for focus changes, 122123

MultiChoiceModeListener(), contextual action mode, 105

Multimedia APIs

media router library, 209

overview of, 191

playing audio, 205206

playing video, 202203

quiz Q & A, 209210, 521

recording audio, 204205

recording video, 200201

ringtones, 208209

searching for multimedia, 207208

sharing audio, 206207

working with, 191192

working with face detection, 203204

Multimedia APIs, still images

assigning as wallpaper, 199

capturing with camera, 192196

choosing among device cameras, 199200

common camera parameters, 197

configuring camera mode settings, 196

sharing images, 198

zooming camera, 197

Multimedia Messaging Service (MMS), 216217

Multiplayer gaming, Google Play game services, 299

Multiple processors, 16

Multiple users, creating on devices, 428429

Multitouch gestures, 123, 129133

MyOnClickListener class, using inner classes, 504

N

name attribute, Google Cloud Save, 299

Naming conventions

applications for tablets, 155

content provider URI, 56

National Geospatial-Intelligence Agency (NGA), World Magnetic Model, 230

Native Android applications, Adobe Air and, 188

NativeBasicsActivity.java, 380381

native_basics.c file, 381

Native code. See Android NDK (Native Development Kit)

Native Development Kit. See Android NDK (Native Development Kit)

Native Google TV apps, 157158

Native libraries, Android NDK

building own NDK project, 380

building sample application, 379

improving performance, 384385

only on Android 1.5 and higher, 377378

Navigation

detecting gestures, 123

optimizing web applications for Google TV, 157

user interface. See Action bars

NdefMessage, 242243

NDEF (NFC Data Exchange Format) Push over NFC, 241243

NDK. See Android NDK (Native Development Kit)

ndk-build script, building own NDK project, 380

Nesting transactions, SQLite, 40, 491

NetworkInfo objects, Android network status, 172

Networking APIs

accessing Internet, 164166

Android network status, 171173

asynchronous operations, 12, 167171

mobile networking, 163

overview of, 163

parsing XML from network, 166167

quiz Q & A, 173, 521

StrictMode, 164

NetworkOnMainThreadException, 164

Network operator name, requesting service information, 214

Network resources, displaying images, 170171

New Project creation wizard, Android Studio, 509512

NfcAdapter class, Android Beam, 242243

NFC Data Exchange Format (NDEF) Push over NFC, 241243

NGA (National Geospatial-Intelligence Agency), World Magnetic Model, 230

Noise, notifications, 86

Nonprimitive types, 53, 170171

Nonprofit Khronos Group, OpenGL ES, 345

Normal broadcasts, 67

Notification.Builder() class, 78, 8081, 83

NotificationCompat library, 78

NotificationCompat.Builder class, 79, 8586, 8890

NotificationListenerService, 91

NotificationManager object, 79, 8081, 83

Notification queue

clearing, 8283

customizing, 8688

expandable and contractible notifications, 8890

setting priority, 9091

updating, 8182

working with, 8081

Notifications

blinking lights, 8485

clearing, 8283

communicating data to user, 24

compatibility, 78

components of simple, 79

customizing, 8688

designing useful, 9192

expandable and contractible, 8890

GCM for Android, 271272

L Developer Preview enhanced, 463464

making noise, 86

notification listener, 91

notification queue, 8081

notifying user, 7778

quiz Q & A, 92, 520

setting priority, 9091

simple text with icon, 7980

sounds of system events, 208

with status bar, 7879

updating, 8182

using NotificationManager service, 79

vibrating phone, 84

for wearables, 158

notify() method, 7981

notifyBuilder variable, 79

O

ObjectAnimator class, property animation, 337

Offload processing, 12, 20

onActionItemClicked() method, contextual action mode, 104

onActivityResult() method, recording speech, 145

onAnimateMove() method, fling gestures, 128

onAnimateStep() method, fling gestures, 128

onBackup() method, 431, 433434

ON_BICYCLE, activity recognition APIs, 261

onBind() method

creating Service, 21

implementing remote interface, 2628

onClick() method

building basic action bars, 100

building web extensions, 185

geocoding locations, 258

playing audio, 205

recording audio, 204205

recording video, 201

onConnected() method, fused location provider, 261

onConnectionFailed() method, fused location provider, 261

OnConnectionFailedListener, 261

onConsoleMessage() method, web extensions, 183

OnCreate() method

action bars, 104105

AsyncTask class, 13

data for Google Analytics, 287

Google Play game services, 297

remote interface, 27

search Activity, 423

Service, 2021, 25

SQLiteOpenHelper, 4748

Thread class, 1516

wallpaper Service, 405

web extensions, 183184

onCreateLoader() method, 16

onCreateOptionsMenu(), search, 420421

onDeleted() method, AppWidgetProvider, 396

OnDestroy() method

Cursor management, 41

data for Google Analytics, 287

Service, 2021, 2425

wallpaper Service, 405

onDisabled() method, AppWidgetProvider, 395

onDisconnected() method, fused location provider, 261

onDoubleTap()method, gestures, 124, 128129

onDoubleTapEvent() method, gestures, 124125

onDown() method, gestures, 124, 128129

onDowngrade() method, SQLiteOpenHelper, 4748

onDraw() method

Canvas object, 305306

single-touch gestures, 126

onDrawFrame() method

Android NDK, 385

GLSurfaceView, 367368

OpenGL ES 2.0, 372

onEnabled() method, AppWidgetProvider, 395

onFaceDetection() callback event, 203204

onFling() method, gestures, 124, 129

OnFocusChangeListener class, 122123

ON_FOOT, activity recognition APIs, 261

OnGlobal LayoutListener class, 121

onInit() method, TTS, 146

OnInitListener interface, TTS, 146

onJsBeforeUnload() method, WebChromeClient, 179

onKeyDown() method, OpenGL ES, 364365, 368

onKeyUp() method, OpenGL ES, 365

onLoaderReset() method, Loaders, 16

onLoadFinished() method, Loaders, 16

onLocationChanged() method, device location, 255256

onLocationChanged() method, geocoding location, 257

onLongPress() method, GestureDetector, 124

onMove() method, gestures, 128129

onNewIntent() method, search Activity, 423

onOpen() method, SQLiteOpenHelper, 4748

onOptionsItemSelected() method, action bar, 104

onOrientationChanged() method, screen, 136

onPause() method, Cursor, 41

onPause() method, WebView, 179180

onPerformSync() method, sync adapters, 429

onPostExecute() method, AsyncTask, 13

OnPreDrawListener class, 120

onPreExecute() method, AsyncTask, 13

onProgressUpdate() method, AsyncTask, 13

onReceive() callback method, broadcasts, 69, 71

onResetLocation() method, gestures, 128129

onRestore() method, 431, 433434

onResume() method

avoiding logging of, 292

Cursor management, 41

WebView state, 179

onScaleBegin() method, multitouch gestures, 132

onScale() helper method, multitouch gestures, 131

onScroll() method, gestures, 124, 129

onSensorChanged() method, 228229

onServiceConnected() method, remote interface, 27

onServiceDisconnected() method, remote interface, 2728

onShowPress() method, gestures, 124

onSingleTapConfirmed() method, gestures, 124

onSingleTapUp() method, gestures, 124

onStartCommand() method, Service, 2022, 25

onStart() method, Service, 2022, 25

onSurfaceChanged() method, wallpaper Service, 405

onSurfaceCreated() method, wallpaper Service, 405

onSurfaceCreate() method, OpenGL ES 2.0, 370

onSurfaceDestroyed() method, wallpaper Service, 405

onTouchEvent() method, gestures, 123, 125127, 131

onTouchEvent() method, wallpaper Service, 405

onTouchModeChanged() method, 120

OnTouchModeChangeListener class, 120

onUpdate() method, App Widget, 395396, 398

onUpgrade() method, SQLiteOpenHelper, 4748

onVisibilityChanged() method, wallpaper, 405

OpenGL ES

cleaning up, 365366

ensuring device compatibility, 346347

GLSurfaceView, 366369

handling tasks manually, 347353

initializing, 352353

leveraging in Android, 346

OpenGL ES 2.0, 369373

OpenGL ES 3.0, 373374

overview of, 345

using APIs in Android SDK, 347

OpenGL ES 3.1, 460461

OpenGL rendering pipeline, 2D graphics, 321

OpenGL Utility Toolkit (GLUT), 352

openOrCreateDatabase() method, SQLite database, 36

Operations, asynchronous networking, 167171

Options menu resource file, action bars, 100101

Ordered broadcasts, 67

Orientation

alternative resources for, 153

changing screen, 134136

determining device, 230

developing tablet applications, 155

using space on big landscape screens, 153154

OrientationEventListener class, 135136

OutOfMemoryError, bitmap optimization, 313314

Output, speech, 139

OutputStream, Bluetooth devices, 238

Ovals, drawing, 319320

OvalShape object, 319320

Overflow menu icon, action bars, 101

OvershootInterpolator, animation, 341

P

Paint object

anti-aliasing, 307

drawing text, 309

gradients, 307

hardware acceleration and, 325

setting properties via XML, 316

styles, 307

understanding, 307

working with canvases and, 305306

working with color, 307

Parallel execute, 14, 16

Parameters class, camera, 196197

Parameters, NDK project, 381382

Parcelable class, 26, 2830

Parents, style inheritance, 109111

Parsing XML from network, 166167

Password protection, software piracy, 450

Pasting data, from system clipboard, 119

Paths, drawing, 322324

PathShape, 323324

pause Timers() method, WebView, 180

PayPal billing APIs, 280

peek Drawable() method, wallpaper, 199

PendingIntent, 8890, 260

Percentage, of battery use, 233

Performance optimization

2D bitmaps, 313

3D graphics in Android NDK, 384385

L Developer Preview, 460461

Permissions

Bluetooth, 235

camera, 192

content provider access, 64

fused location provider, 261

location of device, 254255

making phone calls, 220

monitoring battery use, 231

monitoring Wi-Fi state, 246

phone state information, 212

recording video, 201, 205

sending broadcasts, 6768

sending/receiving SMS messages, 218

setting wallpaper, 199

sounds of system events, 209

using Google Analytics SDK for Android, 286

using GPS in your applications, 254

vibration with notifications, 84

video from Internet resource, 202

WebView control, 175176

Wi-Fi Direct on Android, 246

working with SIP, 221

permitAll() method, skipping StrictMode, 17, 164

Persistent databases, 4648

Personalizing devices, 199, 208209

Phone calls, 220222

PhoneNumberUtils class, 215216, 445

PhoneStateListener, 214215

Pinch-to-zoom, multitouch gestures, 129130

Plug-ins, WebView, 178

postDelayed() method, View class, 15

post() method

OpenGL ES, 362364

View class, 1516

Power issues

battery life, 231233, 461

Daydream, 408

live wallpaper, 406

Precision updates, AppWidgetProvider, 396

Preferences, backing up shared, 432

PrefListenerService class, 398

Press-and-hold action, long-click events, 121

Preview All Screen Sizes, Android Studio, 514

Preview controls, Android Studio, 515

previewImage field, App Widgets, 394

Preview window, Android Studio, 514515

Pricing, antipiracy tips, 454

Printing debug information, 478

Priorities, setting notification, 9091

Privacy, 74, 408

Processors, 16

Programmatically

defining property animation, 339341

defining shape drawables, 316317

defining tweened animations, 333

implementing locale support, 444445

ProgressBar control, 13, 202203, 220

ProGuard, 287, 450452

proguard-project.txt file, 451

Projects, Android Studio, 509, 512

Project Volta, L Developer Preview, 461

Properties

SQLite database, 37

typeface, 310

Property animation

defined, 329

defining as XML resources, 337339

defining/modifying programmatically, 339341

working with, 336337

propertyName attribute, property animation, 338

Provider(s)

account, 428

App Widget, 392396

content. See Content providers

fused location, 260261

location, 254256

SMS, 217

Telephony API service, 214

Publishing applications for foreign users, 446

publishProgress() method, AsyncTask, 13

pull command, retrieving files, 472

Pull Parser, XML, 166167

push command, copying files, 472

Push messaging services, 271273, 275

Q

Queries, paired Bluetooth devices, 237

Queries, SQLite database

complex queries, 44

to multiple tables, 495

overview of, 4041

raw queries, 45

with SELECT, 493

simple queries, 4344

subqueries for calculated columns, 497

using calculated columns, 496497

using sqlite3 to test, 490

working with cursors, 4142

query() method

content provider, 5758

enabling search suggestions, 419

executing simple queries, 4344

retrieving content provider data, 64

Questions, answered in this book, 34

queueEvent() method, GLSurfaceView, 368

Quick Search Box, global searches, 424425

Quick-Start Guides

ADB. See ADB (Android Debug Bridge)

Android Studio. See Android Studio

SQLite. See SQLite databases

Quotas, Google Play game services, 298

R

Radial gradients, 309

Rate limiting management, Google Play game services, 298

Raw HTML, WebView control, 177

rawquery() method, 45

readFromParcel() method, Parcelable class, 29

Reading

data from Web, 164165

sensor data, 228229

text to user, 145147

READ_PHONE_STATE permission, 212

readText() method, text-to-speech, 147

Real-time multiplayer APIs, Google Play game services, 299

<receiver> tag, App Widgets, 399

Receiving

Android Beam messages, 243244

broadcasts, 6973

phone calls, 221222

SMS messages, 218

RecognizerIntent intent, recording speech, 142145

Reconfigure() method, bitmaps, 314

Recording

audio, 204205

video, 200201

Records

deleting SQLite database, 3940

inserting SQLite database, 38

query results corresponding to returned, 41

updating SQLite database, 3839

recordSpeech() method, speech recognition, 145

Rectangles, drawing, 318319

RectEvaluator class, property animation, 337

RectShape object, 318

recycle() method, transforming bitmaps, 313

RecyclerView, L Developer Preview, 462

Referential integrity, SQLite limitations, 491

registerListener() method, sensors, 228230

registerReceiver() method, sticky broadcasts, 67

Registration

of applications using ADB, 431

of backup agent in manifest file, 434

receiving broadcasts and, 6971

Reinstallation, of applications using ADB, 473

release() method, playing audio, 206

Remote backup service, 430431

Remote interface, 19, 2628

RemoteViews class

App Widgets, 396400

customizing notifications, 8688

remove() method, SQLite database records, 3940

Renderer class, GLSurfaceView, 366369

RenderScript

Android NDK vs., 385386

computing with, 385

deprecated in Android 4.1, 374

repeatCount attribute, property animation, 338339

repeatMode attribute, property animation, 338339

Reports, generating bug

Android Debug Bridge, 477

Google Analytics, 284285

Google Analytics Dashboard, 288290

requestLocationUpdates() method, 254

requestRestore() method, 435

requestStop() method, OpenGL ES thread, 350

requiredAccountType attribute, restricted profiles, 429

/res/animator/grow.xml, animations, 333

/res/animator/resource, animations, 332333, 337339

/res/drawable, internationalization, 441

/res/drawable/resource, shape drawables, 315316

/res/layout, internationalization, 440441

/res/values, internationalization, 440441

/res/values/styles.xml, styles, 106109

/res/xml, live wallpaper, 406

Resolution, bitmap, 314

Restore, forcing, 477

RestoreObserver object, 435

restrictedAccountType attribute, profiles, 429

Restricted profiles, tablets, 428429

Return values, building NDK project, 381382

Reverse geocoding, 256

RFCOMM connections, Bluetooth, 235

Right-to-left (RTL) language localization, 445

RingtoneManager object, 208209

Ringtones, 207209

Roaming, 214

RotateAnimation class, 335

Rotating transformations, 335

RoundRectShape object, 318319

RTL (right-to-left) language localization, 445

runOnUiThread() method, Activity, 15

Runtime, L Developer Preview, 460462

S

sample.html file, 185

Sans Serif typeface, drawing on screen, 310

Saving, game data with Cloud Save, 299

Scale

bitmaps, 313

designing flexible user interfaces, 152

loading content into WebView, 178

monitoring battery use, 233

working with transformations, 335336

ScaleAnimation class, 336

ScaleGestureDetector class, 123, 129131

Scenes

lighting 3D, 358360

state animations with, 342

Schema

creating SQLite database, 3738

designing SQLite database, 491492

listing for database with sqlite3, 488

listing for table with sqlite3, 487

Screens

2D drawing on. See Drawing 2D objects

3D drawing on. See Drawing 3D objects

designing flexible user interfaces, 152

handling orientation changes, 134136

listening for events on entire, 120121

listening for focus changes, 122123

listening for long-click event, 121122

listening for touch mode changes, 119120

optimizing web applications for Google TV, 157

removing action bars from, 104105

using alternative resources for, 153

using space effectively on big landscape, 153154

WebView control as entire, 178

Screen saver, Daydream, 408410

Scripts, SQL, 489

Scroll gestures, 124125, 128129

SDK Manager, Android Studio, 508509

Search

in-application, 416417

basic, 417

configuring Android manifest file for, 423424

creating search Activity, 422423

global, 424425

making application content searchable, 415416

multimedia APIs, 207208

quiz Q & A, 426, 525

requesting, 420421

suggestions, 417420

voice, 420

Search button, deprecated, 420

SearchManager class, 417

searchSuggestAuthority attribute, 418

searchSuggestThreshold attribute, 418

SearchView class, 420421

Secondary logs, accessing, 476

Security

application broadcast, 7374

host card emulation applications, 245

JavaScript control for Android app, 187

software piracy. See Software piracy protection

SSL, 164166

video content, with MediaDrm class, 202

Seed feature, stress testing applications, 480

SELECT statement, querying SQLite database tables, 493

Semicolon (;), sqlite3, 490

sendBroadcast() method, 67

Sending

broadcasts, 6768

enabling Android Beam, 241243

SMS, 218220

sendOrderedBroadcast() method, 67

sendStickyBroadcast() method, 67

sendStickyOrderedBroadcast() method, 67

Sensor class, 226227

SensorEvent class, 228

SensorEventListener object, 228

SensorManager class, 226227

Sensors. See Hardware sensors

separator command, sqlite3, 489

Sequential tweened animations, 333

Serial number, ADB commands to specific devices, 470

Serif typeface, drawing on screen, 310

Servers

alternative to GCM, 275

integrating GCM on Android application, 274

Service class

creating App Widget, 393

creating App Widget update Service, 398399

implementing Daydream, 409

updating App Widget, 398399

working with live wallpapers, 404408

ServiceConnection object, remote interface, 2728

Service information, requesting, 214

<service> manifest tag

configuring App Widgets, 399

configuring live wallpapers, 406407

creating Service, 25

implementing remote interface, 27

registering Service implementation, 20

Services

controlling, 25

creating, 2025

default messaging applications, 217

implementing IMEs as Android, 117

implementing IntentService class, 3033

implementing Parcelable class, 2830

implementing remote interface, 2628

lifecycle, 20

overview of, 19

quiz Q & A, 34, 519

when to use, 19

Service Set Identifier (SSID), Wi-Fi state, 247

ServiceState object, call state, 213214

Session Initiation Protocol (SIP), Telephony API, 222223

<set> tag, tweened animations, 333

setAccuracy() method, location of device, 255

setAutoCancel() method, notifications, 83

setBackground() method, drawable animations, 330

setBeam PushUris() method, Android Beam over Bluetooth, 245

setBitmap() method, wallpaper, 199

setBuiltInZoomControls() method, WebView, 178

setClass() method, broadcasts, 74

setcolor() method, Paint, 307

setContentDescription() method, accessibility, 140

setContentText() method, notifications, 80, 87, 89

setContentTitle() method, notifications, 80, 87, 89

setContentView() method, themes, 112

setContentView() method, WebView, 178

setDataSource() method, playing audio, 205

setDisplayHomeAs UpEnabled() method, icon clicks, 104

setEGLContextClient Version() method, OpenGL ES 2.0, 370

setFlags() method, hardware acceleration, 325

setHapticFeedbackEnabled() method, accessibility, 140

setHTMLText() method, web extensions, 185186

setInitialScale() method, WebView, 178

setInterpolator() method, interpolator, 341

setJavaScriptEnabled() method

web extensions, 183

WebView, 178

setLayerType() method, hardware acceleration, 325

setLightTouchEnabled() method, WebView, 178

setMediaController() method, VideoView, 202203

setNdefPushMessageCallback() method, Android Beam, 242

setNotificationUri() method, content provider, 57

setOnClickListener() method, 123, 504

setOnCompletionListener() method, video, 202203

setOneShot() method, drawable animation, 330

setOnFocusChangeListener() method, focus changes, 122123

setOnLongListener() method, View, 123

SetPackage() methods, application broadcasts, 74

setParameters() method, camera, 196

setPowerRequirement() method, location of device, 255

setPreviewFormat() method, camera, 195

setPrimaryClip() method, copying/pasting, 119

setResource() method, wallpaper, 199

setShader() method, Paint, 307309

setSound() method, notifications, 86

setStream() method, wallpaper, 199

setStyle() method, notifications, 8890

setSupportZoom() method, WebView, 178

setTables() method, content provider, 57

setTarget() method, property animations, 339

setTheme(), 111113

Settings

Daydream, 409

WebView, 178179

Settings, Language & import menu, 115

setTint() method, drawable resources at runtime, 462

setVibrate() method, notifications, 84

setVideoURI() method, video, 202203

setWebChromeClient() method, 179

SGI (Silicon Graphics), and OpenGL, 345

SHA-1 fingerprint, map API key, 263264

Shaders, OpenGL ES 2.0, 370373

Shadows, L Developer Preview, 462463

ShapeDrawable

defining as XML resources, 315316

defining programmatically, 316317

using ArcShape object, 320322

using OvalShape object, 319320

using PathShape object, 323324

using RectShape object, 318

using RoundRectShape object, 318319

using view animations, 331332

Shapes

defining shape drawables, 315317

drawing arcs, 320322

drawing ovals and circles, 319320

drawing paths, 322324

drawing rectangles and squares, 318

drawing rectangles with rounded corners, 318319

Shared

audio, 206207

preference files, backing up, 432

still images, 198

Shell commands, ADB

accessing sqlite3 tool, 486

inspecting SQLite databases, 478

installing custom binaries via, 481482

issuing single shell commands, 471

starting and stopping emulator, 471472

stress testing applications, 478481

using shell session, 471

Shorthand, Java, 500504

showAsAction attribute, action bar, 102103

showVoiceSearchButton value, voice search, 420

shutdown() method, text-to-speech, 147

Sidebars, conventions used in this book, 7

Signal strength, Telephony API, 214215

Silicon Graphics (SGI), and OpenGL, 345

SIM operator name, requesting service information, 214

SimpleAccessProvider application, 6364

SimpleAppWidgetActivity, 397

SimpleBackup application, 430435

SimpleBroadcasts application. See Broadcasts

SimpleCursorAdapter

binding data to controls, 5053

creating search Activity, 423

retrieving content provider data, 64

SimpleDataUpdateService class, App Widgets, 398

SimpleGestures application, 125129

SimpleIntentService application, 3133

SimpleInternationalization application. See Internationalizing applications

SimpleLiveWallpaper application, 406

SimpleNetworking application, 164166

SimpleNotifications application. See Notifications

SimpleOnScaleGestureListener class, multitouch, 130

SimpleOpenGL application. See Graphics, 3D applications

SimpleOrientation application, 135136

SimplePropertyAnimation application, 337341

Simple queries, 4344

SimpleSearchableActivity, 422423

SimpleSearchProvider application. See Content providers

SimpleSpeech application, 141145

SimpleTextInputTypes application. See Textual input methods

SimpleWeb application. See Web APIs

SimpleWebExtension application, 183187

SimpleWireless application, 238239

Simultaneous tweened animations, 333

Single-touch gestures

GestureDetector class detecting, 123

handling common, 124129

overview of, 123

SIP (Session Initiation Protocol), Telephony API, 222223

Siri speech-recognizing assistant, Apple, 139

Size

calculating App Widget, 394

GCM for Android limits, 272

SQLite limits, 491

Smartphones

audience for, 153

challenges of games for, 154

Fragment-based design for, 152

scaling graphics for, 154

tablets vs., 154

SmartSmoothZoom() method, camera, 197

SMS

applications other than default, 217218

default messaging application, 215216

overview of, 216

permissions to send/receive messages, 218

sending, 218220

SmsManager, 218220

SMS Provider, 217

SoftKeyboard legacy sample application, 117

Software developers, 1, 67

Software keyboards

choosing appropriate, 116117

customizing, 117118

input using, 115

Speech Recording option, 141142

text input, 115

Software piracy protection

obfuscating with ProGuard, 450452

other antipiracy tips, 453454

overview of, 449

quiz Q & A, 454, 525

secure coding practices, 450

using License Verification Library, 452453

vulnerability of all applications, 449

speak() method, text-to-speech, 147

speech package, 141145

Speech recognition framework, accessibility, 141145

SpeechRecognizer class, 141

SQL

executing commands on sqlite3, 490

executing scripts from files with sqlite3, 489

SQLite databases. See also sqlite3 command-line

binding data to application user interface, 4853

closing and deleting, 4546

common tasks, 485

content providers. See Content providers

creating, 3638

deleting records, 3940

designing persistent databases, 4648

inserting records, 38

inspecting using ADB shell, 478

limitations of, 490491

overview of, 35, 485

querying, 4045

quiz Q & A, 54, 519

storing structured data, 3536

transactions, 40

updating records, 3839

SQLite databases, example

altering/updating data in tables, 495

calculated columns, 496497

creating tables with AUTOINCREMENT, 492

deleting tables, 497

designing schema, 491

foreign/composite primary keys, 493494

inserting data into tables, 492493

overview of, 491

querying multiple tables using JOIN, 495

querying tables for results with SELECT, 493

quiz Q & A, 498, 526

setting typeface, 492

subqueries for calculated columns, 497

SQLite FTS3 extension, 420

sqlite3 command-line

connecting to SQLite database, 486487

debugging tool for database state, 36

executing SQL commands, 490

exploring database, 487488

finding application database file on device, 36

importing/exporting database and its data, 488489

inspecting SQLite database via ADB shell, 478

launching ADB shell, 486

other commands, 490

overview of, 486

using ADB shell interface to run, 472

SQLiteDatabase instance, 36, 37

SQLiteOpenHelper class, 4648

SQLiteQueryBuilder, 44, 5758

Squares, drawing, 322324

/src folders, Android Studio project, 512

SSID (Service Set Identifier), Wi-Fi state, 247

startActivity() method, 221, 263

startActivityForResult() method, 145, 237

startAngle parameter, arcshape, 321322

start command, emulator, 472

startDiscovery() method, Bluetooth devices, 238

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

start() method

drawable animation, 330

property animations, 339

startOffset property, tweened animation, 333

startscan() method, Wi-Fi state, 247

start-server command, ADB server, 470

startService() method, 20, 25

State

animations with scenes/transitions, 342

managing WebView, 181182

monitoring Wi-Fi, 246248

permission to access information on phone, 212

requesting call, 212214

Static inner classes, 504

Statistics. See Google Analytics

Status bar

customizing notifications, 8688

displaying notification queue on, 8082

notifications displayed on, 7778

notifying users with, 7879

updating notifications, 8183

Status, retrieving Android network, 171173

Stepping through code, Android Studio, 516

Sticky broadcasts, 67

STILL, activity recognition APIs, 261

Still images

assigning as wallpaper, 199

camera mode settings, 196

camera parameters, 197

capturing with camera, 192196

choosing device camera, 199200

debugging with Chrome DevTools, 187

sharing images, 198

during video sessions, 201

working with multimedia, 191192

zooming camera, 197

stop command, emulator, 471

stopFaceDetection(), camera, 204

stop() method

drawable animations, 331

playing audio, 205

stopService() method, 20, 25

stopSmooth Zoom() method, camera, 197

Storage

gathering statistics and avoiding, 292

SQLite databases for structured data, 3536

SQLite limitations for procedures, 491

STREAM_NOTIFICATION, making noise, 86

Stretchable graphic formats, 152

StrictMode

impact on networking code, 164

networking code requiring, 12

responsiveness of applications, 17

Structure, of this book, 13

Styles

L Developer Preview improvements, 462

leveraging inheritance, 109111

notification, 8890

Paint, 307, 323324

simple, 106109

themes, 111113

user interface design, 106

<style> tag, 106, 111113

submitScore() method, leaderboards, 298

Subqueries, SQLite database, 497

supportsRtl attribute, RTL language localization, 445

@SuppressWarnings option, exceptions with native code, 383

surfaceCreated() method

Camera, 192195

starting OpenGL ES thread, 349350

surfaceDestroyed() method, Camera, 193, 195

SurfaceHolder, 193195, 202203

SurfaceHolder.Callback, SurfaceView, 348349

SurfaceView

creating for OpenGL ES, 348349

enabling OpenGL threads, 362365

initializing GLS, 352

initializing OpenGL ES, 352

OpenGL ES 2.0, 370373

OpenGL ES APIs in Android SDK, 347

starting OpenGL ES thread, 349350

sweepAngle parameter, arcshape, 321322

Sweep gradients, 309

Sync adapters, synchronizing data with, 429430

Synchronizing data

not using backup services for, 430

notifications, L Developer Preview, 463

overview of, 429430

Syntax, Java, 500504

Synthesized speech, text-to-speech, 145

System images, Android TV, 464465

System-wide accounts, 428

T

Tables, SQLite database

adding data, 492

altering/updating data, 495

creating, 37, 492

deleting, 46, 497

dumping contents with sqlite3, 488489

foreign/composite primary keys, 493494

listing available with sqlite3, 487

querying, 493

querying multiple, 495

Tablets

attracting new types of users, 153

designing flexible user interface, 152

developing applications, 154155

overview of, 151

quiz Q & A, 159, 521

using screen space effectively, 153154

takePicture() method, Camera class, 195, 201

TalkBack application, accessibility, 140

Target Class, application broadcasts, 74

Telephony APIs

making phone calls, 220221

monitoring signal strength/data speed, 214215

permission to access information, 212

quiz Q & A, 223, 521522

receiving phone calls, 221222

requesting call state, 212214

requesting service information, 214

using SMS, 216220

working with phone numbers, 215216

working with SIP, 222223

working with telephony utilities, 211212

TelephonyManager object, 212214

Temp variables, unnecessary Java, 501

10-foot experience, Google TV, 157

Ternary operations, Java, 503

Testing

Android Wear, 158

applications for ART, 460

asynchronous code on real devices, 12

backup services, 435

custom locales, 442

Google Play game services, 296

SQL queries with sqlite3, 490

Text

drawing on screen, 310312

layouts with WebView, 176

measuring screen for, 312

prediction, 118

Text notifications

components, 79

creating with icon, 7980

customizing, 8688

displaying on notification queue, 8082

expandable and contractible, 8890

updating, 83

Text-to-speech (TTS) services, accessibility, 145147

Textual input methods

customizing software keyboards, 117118

overview of, 115

text prediction and user dictionaries, 118

using clipboard framework, 118119

working with software keyboards, 115117

Texturing objects, 3D graphics, 359362

Text view, Android Studio, 514515

TextView control

building simple styles, 106109

implementing text-to-speech, 147

parallel execute to update, 14

updating in UI, 13

updating with Thread, 16

working with view animations, 331332

Themes, user interface design, 111113

Third-party services

in-app billing APIs, 280

backup services, 430

push messaging services, 275

that use ADB for package installation, 473

Thread class

asynchronous network operations, 168169

offload processing off main UI thread, 12

working with, 1516

Threading and asynchronous processing

AsyncTask class, 1214

importance of, 1112

Loaders, 16

overview of, 11

quiz Q & A, 1718, 519

StrictMode, 17

Thread class, 1516

ThreadPoolExecutor, 16

Throttling mechanism, Google Cloud Messaging, 272

ThrowNew() method, exceptions with native code, 382383

Ticker text, 7982

TILTING, activity recognition APIs, 262

timeDistanceFactor, single-touch gestures, 129

TimeEvaluator class, property animation, 337

time mode, LogCat logging, 474

tint attribute, drawable resources at runtime, 462

Title text, notifications, 79, 90

toAlpha value, 334335

Toast messages, 24

ToDegrees property, rotating transformations, 335

toggleFPSDisplay() method, OpenGL/application threads, 365

Tokens, 272, 428

Touch mode, listening for changes, 119120

toXDelta, fromYDelta values, 336

toXScale, toYScale values, 335336

Tracking ID, Google account for Analytics, 284

TransactionBuilder class, 290292

Transactions, SQLite application databases, 40

Transformations, animation, 333

TransitionManager, 342

Transitions, state animations with, 342

TranslateAnimation class, 336

Translation services, internationalizing applications, 445

Transparency, alpha transformations, 334335

Trial editions, preventing application piracy with free, 454

Triggers

creating SQLite database, 3738

SQLite limitations, 491

True north, finding, 230

try/catch block, SQLite database transactions, 40

TTS (text-to-speech) services, accessibility, 145147

Turn-based multiplayer APIs, Google Play game services, 299

TV

Android, 464465

attracting new types of users, 153

Google, 155158

overview of, 151

quiz Q & A, 159, 521

using screen space effectively, 153154

Tweened animations. See View (tweened) animations

TYPE_ALARM, system events, 208

Typefaces, 310312

TYPE_NOTIFICATION, 208

TYPE_ORIENTATION sensor value, 230

U

UI thread

AsyncTask class, 1214

moving network operations off main, 167171

offload processing of main, 12

starting OpenGL ES, 349350

Thread class, 1516

Unary operations, Java, 502

unbindService() method, remote interface, 2728

Uninstallation, of applications using ADB, 473

uninstall command, 473

UNKNOWN, activity recognition APIs, 262

updateAppWidget() method, 398

update() method

building content provider, 5960

records in SQLite database, 3839

updatePeriodMillis attribute, App Widgets, 394

Updates

Android Studio versions, 507

antipiracy tips, 453

App Widgets, 394399

content provider, 62

data in SQLite database tables, 495

global search, 425

UriMatcher class, 57, 5859, 419

URIs

building content provider, 56

enabling search suggestions, 419

locating content, 6364

URL object, 165166, 171

URLUtil class, WebKit API, 182

USB, 239241

UsbAccessory object, 240

UsbManager class, 240241

Use case. See Extending Android application reach

User accounts

backup service. See Backup service

managing with Account Manager, 427428

multiple users, restricted profiles and, 428429

overview of, 427

synchronizing data, 429430

User dictionaries, 118

User input methods

accessibility with alternative, 140

fine-tuned control over, 116

gestures. See Gestures

quiz Q & A, 137, 520

screen orientation changes, 134136

speech recognition services, 141145

textual, 115119

user events, 119123

User interface

action bars. See Action bars

Android guidelines, 9798

Android Studio, 513515

binding data to application, 4853

challenges of games, 154

content provider and, 5556

contextual action mode, 105106

creating devices with flexible, 152

defining App Widgets, 396397

device diversity and, 151154

Google TV variations, 156158

overview of, 97

quiz Q & A, 113

state animations with scenes/transitions, 342

style inheritance, 109111

styles, 106109

themes, 111113

UserDictionary content provider, 118

Users

attracting to new types of devices, 153

designing notifications, 7779, 9192

with disabilities. See Accessible applications

L Developer Preview improvements for, 461464

protecting privacy when collecting statistics, 293

Users overview reports, Google Analytics, 288

<uses-feature> manifest tag

configuring Android Beam, 244245

configuring for Open GL ES 2.0, 369

configuring sensors, 227

configuring USB, 240241

declaring Bluetooth, 237

declaring device features, 152

improving performance with Android NDK, 384

OpenGL ES device compatibility, 346347

requesting CAMERA permissions, 192

using GPS, 254

<uses-sdk> manifest tag

configuring for Open GL ES 2.0, 384

creating Android NDK Project, 380

creating live wallpaper, 407

improving graphics performance, 380

V

Validation, parsing XML, 167

ValueAnimator class, property animation, 337

valueFrom attribute, property animation, 338339

valueTo attribute, property animation, 338339

valueType attribute, property animation, 338

Variables, unnecessary Java temp, 501

Verbose logging, 478

Versions

Android SDK OpenGL ES, 346

Android Studio updates, 507

devices running Android NDK, 377378

preventing application piracy by blocking old, 453454

Vertex buffer, drawing vertices, 353355

Vertices

coloring, 355356

drawing 3D objects, 353354

lighting scenes, 358360

Vibration, phone notifications, 83

Video

playing, 202203

recording, 200201

VideoView widget, 202203

view.accessibility package, 140

View attribute values, 106

View class, 305306

View controls

accessibility, 140

detecting user motion, 123124

handling user events, 119123

hardware acceleration, 325326

property animations, 339341

varying for animation, 331

ViewGroup, scene state transitions, 342

View hierarchies, RemoteViews, 396

View objects

contextual action mode, 105

making styles, 111

themes, 111113

Viewport, OpenGL ES, 352

ViewPropertyAnimator class, 337, 340

Views

interacting with OpenGL ES and Android, 362365

SQLite limitations, 491

ViewTreeObserver class, 120121

View (tweened) animations

alpha transparency transformations, 334335

defined, 329

defining as XML resources, 332333

defining programmatically, 333

defining simultaneous/sequential, 333

loading, 334

moving transformations, 336

rotating transformations, 335

scaling transformations, 335336

working with, 331332

View widgets, L Developer Preview, 462463

Voice search, enabling, 420

Vulnerabilities, software piracy protection, 450

W

Wallpaper

live, 404408

still images as, 192, 199

WallpaperManager class, 192, 199

WallpaperService class, 404408

<wallpaper> XML tag, 406

Wearables

attracting new types of users, 153

developing applications, 158159

quiz Q & A, 159, 521

Web APIs

browsing with WebView. See WebView control

building web extensions, 182187

debugging WebViews, 187

overview of, 175

quiz Q & A, 188, 521

working with Adobe AIR and Flash, 187188

WebBackForwardList class, WebKit API, 182

WebChromeClient class, 179181, 183184

WebHistoryItem class, WebKit API, 182

WebKit rendering engine, 175, 182

WebSettings class, WebView, 178179

WebViewClient class, 179

WebView control

adding browser chrome, 179181

adding features, 178

browsing Web, 175176

building web extensions, 182187

designing layout, 176

handling events, 179180

loading content, 176178

managing state, 181182

modifying settings, 178179

WHERE clause

executing simple queries, 4344

remove() method, 3940

update() method, 38

Wi-Fi

monitoring state, 246248

overview of, 245

Wi-Fi Direct, 245246

WifiManager object, 246248

WifiP2pManager class, 246

Wildcards, enabling search, 419420

Work queue, 3033

World Magnetic Model, 230

writeToParcel() method, Parcelable class, 29

wtf error, filtering log events, 475

X

XML

creating App Widget, 393394

creating search configuration, 417420

defining property animation, 337339

defining shape drawables, 315316

defining tweened animations, 332333

editor, in Android Studio text view, 514515

parsing from network, 166167

XMLPullParser()method, 166167

XMPP, 275

Z

Zoom

camera settings, 197

modifying WebView control, 178

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

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