A B C D E F G H I J K L M N O P Q R S T U V W X

A

[top]

accessing strings, 42

ActionBar class, applying, 207-213

actions, 32

buttons, formatting, 97-102

loaders, 326

notifications, building with, 341

ACTION_VIEW, 195

activities, 5-6

blank, 12, 67

buttons, adding, 18

code, adding to start, 21-23

colors, formatting, 43

configuring, modifying, 60-63

data, passing data between, 24

development, 7-8

formatting, 20-21

fragments, 53. See also fragments

formatting, 67-69

overview of, 66-70

Intents class, starting, 17-27

IntentService class, starting from, 81

layouts, applying, 54

lifecycles, 63-66

with ListViews, 121

MainActivity

checking for saved data, 62

formatting, 55

MessageActivity, 55, 58-59

overview of, 53-63

results, returning, 54-60

Settings, generating, 256

starting, 23

viewing, 18

Activity class, 8

adapters, 119

ArrayAdapters, applying, 120-121

BaseAdapters, 124-130

view holder patterns, implementing, 131-135

AdapterViewFlipper class, applying, 172-174

adding

animation to FABs (floating action buttons), 158

apps on Google Play, 383

blank activities, 12

BroadcastReceiver to IntentService class, 81-86

buttons to activities, 18

CardView, 146-148

child views

BaseAdapters, 126-130

to toolbars, 217-219

code to start activities, 21-23

data

to databases, 266-267

for the Spinner, 162-163

destinations, 340

elevation, 145

fields to databases, 270

hints, 96

icons

to menu items, 211

to notifications, 341

images to ImageButton class, 98

imports on the fly, 22

MediaController to VideoViews, 197

navigating, 207

notifications

to chronometers, 343

Wear (Android), 353-354

Show Map buttons, 30

strings

resources, 100

viewing in TextView, 94

subscreens, 254

TextView components, 93

titles, 254

toolbars, 216

up navigation, 213

Add() method, 69

AddToBackStack() method, 69

ad supported applications, 384

aligning

to parents, 108-110

views, RelativeLayout, 110-112

Alpha levels, configuring, 185

alternative resources, 48

Amazon, publishing on, 384

Android

Calendar app and, 298-299

defining, 3-5

developer documentation, 369-373

locales, handling, 50

manifest files, 6, 13

platforms, 347-348

TV. See TV (Android)

updating, 369

Wear. See Wear (Android)

Android Asset Studio, formatting icons, 377

AndroidManifest.xml file, 80, 315, 376-377

Android Studio, 4, 10-14

activities, starting, 17-27

content providers, formatting, 312

installing, 11

IntentServices class, applying for, 86-87

layouts, formatting, 106-107

ListViews, 119

package files, exporting, 378

projects, formatting, 11-14

Settings activity, generating, 256

Show Map buttons, adding, 30

UI (user interface) controls, 91-92

user interfaces, formatting, 18-19

wearable apps, formatting, 349

Android Virtual Device. See AVD

animation, 143

to FABs (floating action buttons), adding, 158

sliding drawer, 220

APIs (application programming interfaces), 4, 234

Flickr APIs, 278

OpenGL ES graphics, 372

remote. See remote APIs

wearable apps, 353

Apple, iCal, 298

application programming interfaces. See APIs

applications (apps)

activities, 5

Calendar app, 298-299

CalendarContract content provider, 300-307

databases, applying, 269-274

emulators, running in, 23

evolution of app design, 139-140

localization, 50

private storage, 236-239

public storage, 240-241

publishing, 375

Amazon, 384

Google Play Services, 382

monetizing, 384-385

preparing for release, 375-382

sharing, 382-384

remote APIs, formatting, 286-290

resources

referencing, 40-41

viewing, 39

responsive, 73. See also background processes

signing, 378

themes, configuring, 145

wearable apps, 347

applying

ActionBar, 207-213

activities, 53-63

AdapterViewFlipper, 172-174

Android Studio

for IntentServices class, 86-87

UI (user interface) controls, 91-92

ArrayAdapters, 120-121

AsyncTask class, 76-78

BitmapFactory.Options class, 187-189

bitmaps, 186-191

Bluetooth, 373

colors, 42-43

Crashlytics, 369

databases, 269-274

dimensions, 44-45

drawable images, 45-46

EditText, 96

Fabric, 369

fragments, 70

Framelayout, 116

Google Play Services, 361-364

GridView, 171

implicit Intents, 27-32

languages, 49-51

layouts, 54

LinearLayout, 115

locations, 364-367

OnItemClickListener, 122-123

OpenGL ES graphics APIs, 372

padding, 113

Picasso, 192, 368

PieDbAdapter class, 270, 312

Pie objects, 262

queries, 267-269

Realm, 369

RecycleView, 148-154

resources, 40-48

SDKs (software development kits), 368-369

sensors, 370-371

services, background processes, 79-87

SharedPreferences, 245

SimpleCursorAdapter class, 271-274

StartActivityForResult, 54-60

strings, 41-42

styles, 47-48

toolbars, 214-219

<uses-feature> tag, 377

VideoViews, 196-197

View.post() method, 76

AppThemeNoActionBar style, 216

ArrayAdapters class, 170

arrays, adding data to resources, 123

AsyncTask class, 76-78, 282, 287

attributes

layouts, 112-113

showAsAction, 209

audio, playing MediaPlayer, 202-204

AutoCompleteTextView class, 164

AVD (Android Virtual Device), 347

TV (Android), 356

Wear (Android) apps, 351

B

[top]

backgrounds

downloading in the, 287

processes, 73-76

AsyncTask class, 76-78

post() method, 75-76

services, 79-87

UI (user interface) threads, 73-74

BaseAdapters class, 124-130

Beam, 373

bindView() method, 332

BitmapFactory.Options class, 187-189

bitmaps, 179, 186-191

blank activities, 12, 67

blocking UI threads, 74

Bluetooth, applying, 373

BroadcastReceivers class, 7

broadcasts, sending, 7

Bundle class, 62

buttons

actions, formatting, 97-102

activities, adding, 18

clicking, 22, 99-102

properties, 97-98

C

[top]

caches

directories, 239

storage, 235. See also file systems

Calendar app, 298-299

CalendarContract content provider, 300-307

calls, remote APIs, 278

cameras, 372

Canvas class, 186-191

cards, 144

CardView class, 146-148, 332-333

certificates, exporting files, 381

CheckBox class, 164-166

CheckBoxPreference class, 250-252

child views, 108

BaseAdapters, adding, 126-130

modifying, 123-124

toolbars, adding, 217-219

chronometers, adding notifications, 343

classes, 8-10

ActionBar

applying, 207-213

up navigation, 213

Activity, 8

AdapterViewFlipper, applying, 172-174

ArrayAdapters, 120-121, 170

AsyncTask, 76-78, 282, 287

AutoCompleteTextView, 164

BaseAdapters

adding child views, 126-130

formatting, 125-126

BitmapFactory.Options, 187-189

BroadcastReceiver, 10

adding IntentService class, 81-86

IntentService class, adding, 81-86

BroadcastReceivers, 7

Bundle, 62

Canvas, 186-191

CardView, 146-148, 332-333

CheckBox, 164-166

CheckBoxPreference, 250-252

ContentProvider, 311-312

CursorAdapter, 327-329, 330-332

CursorLoader, 297, 324, 327-329

CursorLoaders, 323

DelayService, 81

EditText, 96

EditTextPreference, 253

Framelayout, 114

GestureDetector, 371

GooglePlex, 31

GridLayout, 105

GridView, 171

HttpUrlConnection, 280-281

ImageButton, adding images, 98

ImageViews, 179

navigating, 179-185

ScaleType property, 180

Intents, 6, 9, 17-27

IntentService, 9, 79-87

IntentServices, 6

LinearLayout, 105, 114-115

ListPreference, 252-253

ListViews, 119, 170

adding child views, 126-130

applying OnItemClickListener, 122-123

ArrayAdapters, 120-121

display information, 127

modifying child views, 123-124

overview of, 119-124

populating, 122

viewing data, 122

Loader, 324

LoaderManager, 324

LoaderManagerCallbacks, 325

loaders, 324-325

MainActivity, 17, 340

checking for saved data, 62

formatting, 55, 57

MediaController, adding VideoViews, 197

MediaPlayer

objects, 202

playing audio, 202-204

MessageActivity, 55, 58-59

MyContentProvider, 314, 319-321

Notification, 338

Notification.Builder, 338-339

NotificationManager, 338

notifications, 338

PendingIntent, 338

PhotoCursorAdapter, 331

PieDbAdapter, 263-266, 270, 312

PlaceholderFragment, 69

PreferenceActivity, generating, 256

PreferencesFragment, 249-250

ProgressBar, 78, 166-170

RadioButtons, 164-166

RecycleView, 146, 148-154

RelativeLayout, 93, 106, 114

aligning views, 110-112

navigating, 108-112

RemoteViews, 344

RippleDrawable, 157

ScrollView, 177

SecondActivity, 20-21

SecondaryActivity, 17

SeekBars, 166-170

Service, 79

SharedPreferences

applying, 245

configuring user preferences, 249-257

data types, 248

methods, 248

reading from, 246-248

storage, 245-248

SimpleCursorAdapter, 271-274, 300

Spinner, 161, 217

adding data, 162-163

retrieving data, 163

SQLiteOpenHelper, managing data, 263-266

SwitchPreference, 252-253

TableLayout, 114

TextView, 37, 41

adding components, 93

aligning to parents, 110

applying styles, 48

positioning components, 93

UI (user interface) controls, 91

viewing strings, 94

UriMatcher, 314

VideoViews, 195, 204

adding MediaController, 197

applying, 196-197

classes, 204

handling events, 199-202

pausing video, 198

playing audio with MediaPlayer, 202-204

playing video, 195-199

positioning video, 198

starting video, 198

WearDestinationActivity, 353

WebView, 174-177

clauses, where, 267

clicking

buttons, 22, 99-102

responding to, 211

cloud, 277

applications (apps), formatting, 286-290

connecting, 290-294

JSON (JavaScript Object Notation), 282-286

code

activities, adding to start, 21-23

applications (apps), viewing resources, 39

loaders, 333

MainActivity.java, 207

OnClick property, 101

sliding drawer activities, 226

colors

applying, 42-43

design, 142

formatting, 43

text, modifying, 95

<color> tag, 42

command-line tools, signing apps, 380

Commit() method, 69

common resources, 40-48

communication, NFC, 373

components

design, 91

of notifications, 337

TextView

adding, 93

positioning, 93

conditions, resources, 37. See also resources

configuring

activities, modifying, 60-63

Alpha levels, 185

elevation, 145

Google Play Services, 361-363

preferences, 245-246

sliding drawer navigation, 222-224

themes, 145

user preferences, 249-257

wearable apps, 349

connecting

cloud, 290-294

Google Play Services, 363-364

constructors, 150

ContentProvider class, 311-312

content providers, 297

Calendar app, 298-299

CalendarContract, 300-307

declaring, 314-315

formatting, 311

applying PieDbAdapter class, 312

defining URIs, 312-319

specifying URIs, 311

getType() method, 317

MyContentProvider class, 319-321

overview of, 297

query() method, 315

controls, 161

AutoCompleteTextView, 164

CheckBox, 164-166

data display, 170-174

information collection, 161-166

progress indicators, 166-170

RadioButtons, 164-166

UIs (user interfaces), 91

applying Android Studio, 91-92

creating buttons (for actions), 97-102

handling input, 92-96

ViewGroup, 372

Crashlyticsm, applying, 369

createBitmap() methods, 191

creating. See formatting

CursorAdapter class

CursorLoader class, 327-329

formatting, 330-332

CursorLoader class, 297, 324

CursorAdapter class, 327-329

overview of, 324

CursorLoaders class, 323

cursors, applying queries, 267-269

customizing

notifications, 342, 344-345

styles, 372

themes, 372

views, 372

D

[top]

data

adding/deleting/updating, 266-267

remote APIs, fetching, 277-282

SQLiteOpenHelper class, managing, 263-266

databases, 261

applications (apps), applying, 269-274

data, adding/deleting/updating, 266-267

fields, adding, 270

queries, applying cursors, 267-269

tables, managing, 261-262

data types, SharedPreferences class, 248

declaring content providers, 314-315

default resources, specifying, 50

defining

Android, 3-5

IntentService class, 80

queries, 268-269

URIs (Uniform Resource Identifiers), 312-319

DelayService class, 81

delete() method, 312, 318

deleting data from databases, 266-267

density-independent pixel. See dp

design

components, 91

flat, 140

layouts, 106-107

materials, 139

3D space, 141

animation, 143

cards, 144

evolution of app design, 139-140

graphics, 142

implementing, 145-159

overview of, 140-144

shadows, 141

typography, 143

RelativeLayout, 112

TV (Android), 355

wearable apps, 348

desktops, 139

destinations, adding, 340

developers

documentation, 369-373

signing up as, 278

development

activities, 5-8

BroadcastReceivers, 7

environments, 4. See also IDEs

intents, 6

IntentServices, 6

overview of, 5

services, 7-8

TV (Android), 355-357

Wear (Android) apps, 348-354

dimensions, applying, 44-45

directories

cache, 239

resources, qualifiers, 48

display information, ListViews, 127

displays, fragments, 70

documentation, developers, 369-373

doInBackground() method, 76, 287

dots per inch. See dpi

downloading

Android Studio, 11

in the background, 287

dp (density-independent pixel), 45

dpi (dots per inch), 45

dragging and dropping

images, 48

TextView components, 93

drawable images, 40, 45-46. See also images

drawing on Canvas, 190-191

E

[top]

editing, 91, 107

EditText class, applying, 96

EditTextPreference class, 253

elevation, configuring, 145

emulators

applications, running in, 23

maps, applying, 29

environments, development, 4. See also IDEs

events. See also Calendar app

inserting, 307

lists of attendees, 306

VideoViews, handling, 199-202

viewing, 305

evolution of app design, 139-140

execute() method, 77

explicit Intents, 27

exporting

files, certificates, 381

package files, 378

extending

BaseAdapter, 119

PreferencesFragment, 249

external SDKs (software development kits), 368-369

external storage, 233-234. See also file systems

files, saving, 241

F

[top]

Fabric, applying, 369

FABs (floating action buttons), 141, 155-159

features, 361-367

fetching data, remote APIs, 277-282

fields, adding to databases, 270

filename rules, 40

files

Android manifest, 6, 13

AndroidManifest.xml, 80, 315, 376-377

certificates, exporting, 381

external storage, saving, 241

images, moving, 48

layouts, 40, 91

package

exporting, 378

testing, 381

resources, formatting, 42

storage, 261

XML, RelativeLayout, 106

file systems, 233

overview of, 233-236

private storage, 236-239

public storage, 240-241

findViewById() method, 54, 353

flat design, 140

Flickr APIs, 278, 282

floating action buttons. See FABs

folders, navigating resources, 39

fonts, sizing, 44

formatting

activities, 20-21

BaseAdapters, 125-126

buttons (for actions), 97-102

colors, 43

content providers, 311

applying PieDbAdapter class, 312

defining URIs, 312-319

specifying URIs, 311

CursorAdapter class, 330-332

databases, applications (apps), 269-274

display information, ListViews, 127

fragments, activities, 67-69

icons, Android Asset Studio, 377

Intents with latitudes/longitudes, 28-29

JSON (JavaScript Object Notation), 282-286

JSONArray, 283-284

JSONObject, 283

layouts, 106-107, 113

loaders, 326

MainActivity, 55, 57

MessageActivity, 58

notifications, 338-343

projects, Android Studio, 11-14

queries, 274

remote APIs, 286-290

resources, files, 42

sliding drawer navigation, 222-224

strings, 41

TV (Android), 355-357

URIs (Uniform Resource Identifiers), 297

user interfaces, 18-19

Wear (Android) apps, 348-354

forms, RelativeLayout, 112

fragments

activities, 53

formatting, 67-69

lifecycles, 63-66

overview of, 53-63

layouts, applying, 70

lists, viewing, 289

overview of, 66-70

FragmentTransction object, 69

Framelayout class, 114, 116

free applications, 384

functionality, 10

G

[top]

generating

PreferenceActivity class, 256

Settings activity, 256

signed APKs, 378

geo Intent, viewing GooglePlex, 31

GestureDetector class, 371

gestures, handling, 371

getActiveNetworkInfo() method, 290

getApplicationContext() method, 23

getAssets() method, 204

getCheckedRadioButtonID() method, 166

getColumnIndex() method, 269

getExternalFilesDir() method, 240-241

getItemCount() method, 150

getLoaderManager() method, 325

getPieFromCursor() method, 269

getResources() method, 40

getSharedPreferences() method, 246

getString() method, 42

getText() method, 61, 96, 164

getType() method, 312, 317

getView() method, 131

global positioning system. See GPS

Google

Calendar, 298

Play Services

applying, 361-364

configuring, 361-363

connecting, 363-364

locations, 364-367

publishing on, 382

GooglePlex class, 31

GPS (global positioning system), 364. See also locations

graphics, 142

gravity, 115

GridLayout class, 105, 114

GridView class, applying, 171

guidelines for images, 142

H

[top]

handling

buttons, clicking, 99-102

events, VideoViews, 199-202

implicit Intents, 32-34

large images, 186-187

locales, 50

selection, 224

users

gestures, 371

input, 92-96

hasExtra() method, 33

Hello World, 37, 40

hints, adding, 96

holder patterns, implementing views, 131-135

horizontal scrolling, 174

HTTP (Hypertext Transfer Protocol), 278

HttpUrlConnection class, 280-281

Hypertext Transfer Protocol. See HTTP

I

[top]

icons

Android Asset Studio, formatting, 377

menu items, adding, 211

notifications, adding to, 341

IDEs (integrated development environments), 4. See also Android Studio

ImageButton class, 98

images

drawables, 40

guidelines, 142

ImageButton, adding, 98

large, handling, 186-187

moving, 48

rotating, 183-185

sizing, 44

viewing, 179-180

ImageViews class, 179

navigating, 179-185

ScaleType property, 180

implementing

bindView() method, 332

BroadcastReceiver, 82

material design, 145-159

newView() method, 330

onCreateLoader() method, 329

onLoaderReset() method, 329

onLoadFinished() method, 329

view holder patterns, 131-135

implicit Intents, 27

applying, 27-32

handling, 32-34

importing

FABs (floating action buttons), 156

on the fly, adding, 22

in-app payments, 384

<include/> element, 106

information collection controls, 161-166

Input controls, 92

inputType properties, 96

inserting events, 307

insert() method, 312, 318

installing

Android Studio, 11

Picasso, 192

integrated development environments. See IDEs

Intents

explicit, 27

implicit, 27

applying, 27-32

handling, 32-34

latitudes/longitudes, creating with, 28-29

video, playing, 195

Intents class, 6, 9, 17-27

IntentService class, 9, 79-87

activities, starting from, 81

AndroidManifest.xml file, updating, 80

BroadcastReceiver, adding, 81-86

defining, 80

IntentServices class, 6, 86-87

interfaces, 5. See also APIs

internal padding, 113

internal storage, 233-234. See also file systems

internationalization, 49-51

items, adding icons, 211

J

[top]

Java. See also code

applications (apps), viewing resources, 39

MainActivity.java code, 207

Java Development Kits. See JDKs

JavaScript Object Notation. See JSON

JDKs (Java Development Kits), 380

JSON (JavaScript Object Notation), 282-286

JSONArray, formatting, 283-284

JSONObject, formatting, 283

K

[top]

keys

applications, signing, 378

stores, formatting, 381

L

[top]

languages, 49-51

large images, handling, 186-187

latitudes, creating with intents, 28-29

launching. See starting

layout_gravity property, 115

layouts, 105

activities, applying, 54

attributes, 112-113

editing, 107

files, 40, 91

formatting, 106-107

fragments, applying, 70

ListViews, display information, 127

margins, 113

notifications, 344

overview of, 105-108

RelativeLayout, navigating, 108-112

resources, programming, 108

sliding drawer navigation, 220-222

types, 114-116

layout_weight property, 115

lifecycles, activities, 63-66

LinearLayout class, 105, 114-115

listening for states, ViewViews, 199-202

ListPreference class, 252-253

lists

event of attendees, 306

fragments, viewing, 289

ListViews class, 119, 170

ArrayAdapters, applying, 120-121

child views

adding, 126-130

modifying, 123-124

data, viewing, 122

display information, 127

OnItemClickListener, applying, 122-123

overview of, 119-124

populating, 224

Loader class, 324

LoaderManagerCallbacks class, 325

LoaderManager class, 324

loaders, 323

actions, 326

classes, 324-325

code, 333

CursorAdapter class, formatting, 330-332

formatting, 326

overview of, 324

resetting, 326

states, 325-330

locales, handling, 50

locations

Google Play Services, 364-367

maps, opening, 28

tracking, 365-367

Lollipop, 4. See also OS (operating systems)

longitudes, creating with intents, 28-29

M

[top]

MainActivity class, 17, 340

formatting, 55, 57

saved data, checking for, 62

MainActivity.java code, 207

makePies() method, 127

managing

data, SQLiteOpenHelper class, 263-266

databases with tables, 261-262

notifications, 338-343

maps

opening, 28

viewing, 29-31

margins, layouts, 113

material design, 139

3D space, 141

animation, 143

cards, 144

evolution of app design, 139-140

graphics, 142

implementing, 145-159

overview of, 140-144

shadows, 141

typography, 143

media, VideoViews, 195

adding MediaController to, 197

applying, 196-197

audio with MediaPlayer, 202-204

classes, 204

handling events, 199-202

pausing video, 198

playing video, 195-199

positioning video, 198

starting video, 198

MediaController class

VideoViews

adding, 197

MediaPlayer class

audio, playing, 202-204

objects, 202

memory, OOM (out-of-memory), 187

menus

icons, adding, 211

overflow, 209

MessageActivity class, 55, 58-59

methods

Add(), 69

AddToBackStack(), 69

bindView(), 332

Commit(), 69

ContentProvider class, 312

createBitmap(), 191

delete(), 312, 318

doInBackground(), 76, 287

execute(), 77

findViewById(), 54, 353

geSharedPreferences(), 246

getActiveNetworkInfo(), 290

getApplicationContext(), 23

getAssets(), 204

getCheckedRadioButtonID(), 166

getColumnIndex(), 269

getExternalFilesDir(), 240-241

getItemCount(), 150

getLoaderManager(), 325

getPieFromCursor(), 269

getResources(), 40

getString(), 42

getText(), 61, 96, 164

getType(), 312, 317

getView(), 131

hasExtra(), 33

insert(), 312, 318

makePies(), 127

moveToFirst(), 268

moveToLast(), 268

moveToNext(), 268

moveToPrevious(), 268

newView(), 330

onActivityCreated(), 325

onBindViewHolder(), 150

OnClickListener(), 21

onClickListener(), 30, 99

onConnected(), 367

onConnectionFailed(), 363

OnCreate(), 13, 33, 53

onCreate(), 21, 64-66, 249, 312

onCreateLoader(), 325, 329

onCreateMenuOptions(), 211

onCreateView(), 69

onCreateViewHolder(), 150

onHandleIntent(), 81

onItemClickListener(), 122-123, 303

onLoaderReset(), 329

onLoadFinished(), 329

onOptionsItemSelected(), 211

onPause(), 64-66, 203

onPostExecute(), 77

onPreExecute(), 76

OnPreparedListener(), 199

onProgressUpdate(), 77, 168

onResume(), 64-66

onStart(), 64-66, 364

onStop(), 64-66

openFileOutput(), 239

pause(), 199

post(), 75-76

postExecute(), 77

publishProgress(), 76, 167

query(), 312

Remove(), 69

Replace(), 69

resolveActivity(), 30

run(), 75

SaveInstanceState(), 61-62

seekTo(), 199

sendBroadcast(), 10

setAlpha(), 185

setAnchorView(), 197

setAutoCancel(), 338

setContentIntent(), 341

setContentView(), 54

setImageBitmap(), 179

setImageDrawable(), 179

setImageResource(), 179

setImageUri(), 179

setLargeIcon(), 341

setOnClickListener(), 74

setTextViewText(), 344

SetTransition(), 69

SharedPreferences class, 248

start(), 199

startActivity(), 6, 195

startService(), 81

SystemClock.sleep(), 74

update(), 312, 318

View.post(), 76

mobile platforms, 5

modifying

activities, configuring, 60-63

child views, 123-124

queries, 321, 330

ScaleType property, 181

text

colors, 95

strings, 94

monetizing applications (apps), publishing, 384-385

moveToFirst() method, 268

moveToLast() method, 268

moveToNext() method, 268

moveToPrevious() method, 268

moving

images, 48

TextView components, 93

MP3 audio files, playing, 203

MyContentProvider class, 314, 319-321

N

[top]

navigating

ActionBar, applying, 207-213

adding, 207

ImageViews, 179-185

RelativeLayout, 108-112

resources, 37

common, 40-48

folders, 39

sliding drawer navigation, 219-228

toolbars, applying, 214-219

up navigation, 213

near-field communication. See NFC

newView() method, 330

NFC (near-field communication), 373

Notification.Builder class, 338-339

Notification class, 338

NotificationManager class, 338

notifications, 337

chronometers, adding, 343

customizing, 342, 344-345

formatting, 338-343

overview of, 337-338

Wear (Android), adding, 353-354

O

[top]

objects

cursors, retreiving, 269

FragmentTransction, 69

JSON (JavaScript Object Notation), 282-286

MediaPlayer, 202

Pie, applying, 262

onActivityCreated() method, 325

onBindViewHolder() method, 150

onClickListener() method, 21, 30, 99

onClick property, 99

onCompletionListener, 200

onConnected() method, 367

onConnectionFailed() method, 363

onCreateLoader() method, 325, 329

onCreateMenuOptions() method, 211

onCreate() method, 13, 21, 33, 53, 64-66, 249, 312

onCreateViewHolder() method, 150

onCreateView() method, 69

onDestroy() method, 64-66

onHandleIntent() method, 81

onItemClickListener() method, 122-123, 303

onLoaderReset() method, 329

onLoadFinished() method, 329

onOptionsItemSelected() method, 211

onPause() method, 64-66, 203

onPostExecute() method, 77

onPreExecute() method, 76

onPreparedListener() method, 199

onProgressUpdate() method, 77, 168

onResume() method, 64-66

onStart() method, 64-66, 364

onStop() method, 64-66

on the fly, adding imports, 22

OOM (out-of-memory), 187

openFileOutput() method, 239

OpenGL ES graphics APIs, 372

opening maps, 28

open source SDKs (software development kits), 368-369

operating systems. See OSs

Options menu, viewing, 207-209

OS (operating systems), 3, 139

out-of-memory. See OOM

overflow menus, 209

owner data, viewing, 332

P

[top]

package files

exporting, 378

testing, 381

padding, 113

paging, 174

paid models, applications, 384

palettes, Android Studio, 91. See also Android Studio

parents, aligning to, 108-110

parsing JSON (JavaScript Object Notation), 284-286

passing data between activities, 24

patterns, view holder, 131-135

pause() method, 199

pausing video, 198

PendingIntent class, 338

personal computers. See PCs

PhotoCursorAdapter class, 331

Picasso

applying, 368

overview of, 192

PieDbAdapter class, 263-266, 270, 312

Pie objects, applying, 262

pixels, sizing, 44

PlaceholderFragment class, 69

platforms

Android, 347-348

mobile, 5

playing. See also viewing

audio, MediaPlayer, 202-204

video, 195-199

populating ListViews, 224

positioning

TextView components, 93

video, 198

postExecute() method, 77

post() method, 75-76

PreferenceActivity class, generating, 256

preferences

configuring, 245-246

reading, 256

SharedPreferences, applying, 245

types, 251

user, configuring, 249-257

PreferencesFragment class, 249-250

primary colors, design, 142

private storage, 235. See also file systems

applications (apps), 236-239

processes, background, 73-76

AsyncTask class, 76-78

post() method, 75-76

services, 79-87

UI (user interface) threads, 73-74

programming

layouts, resources, 108

ScaleType property, 181

ProgressBar class, 78, 166-170

progress indicators, 166-170

projects

Android Studio, formatting, 11-14

resources, 37-39

structures, viewing, 38

properties

buttons, 97-98

inputType, 96

layout_gravity, 115

layout_weight, 115

OnClick, 99

padding, 113

ScaleType, 180-183

textColor, 95

public storage, 235, 240-241. See also file systems

publishing

applications (apps), 375

monetizing, 384-385

preparing for release, 375-382

sharing, 382-384

systems, 7

publishProgress() method, 76, 167

Q

[top]

qualifiers, directories, 48

queries

cursors, applying, 267-269

defining, 268-269

formatting, 274

modifying, 321, 330

query() method, 312, 315

R

[top]

RadioButtons class, 164-166

READ_EXTERNAL_STORAGE permission, 235

reading

app data, 237

preferences, 256

from SharedPreferences class, 246-248

Realm, applying, 369

RecycleView class, 146, 148-154

referencing resources, applications (apps), 40-41

RelativeLayout class, 93, 106, 114

navigating, 108-112

views, aligning, 110-112

releasing applications, 375. See also publishing

remote APIs, 277

applications (apps), formatting, 286-290

calls, 278

connecting, 290-294

data, fetching, 277-282

JSON (JavaScript Object Notation) data, 282-286

RemoteViews class, 344

Remove() method, 69

Replace() method, 69

requests, 6

resetting loaders, 326

resolveActivity() method, 30

resources, 37

alternative, 48

applications (apps)

referencing, 40-41

viewing, 39

arrays, adding data to, 123

colors, 42-43

common, 40-48

default, specifying, 50

dimensions, 44-45

directories, qualifiers, 48

drawable images, 45-46

filename rules, 40

files, formatting, 42

folders, navigating, 39

languages, 49-51

layouts, programming, 108

projects, 37-39

sizing, 44

storage, 40

strings, 41-42, 100

styles, 47-48

responding to clicks, 211

responsive applications (apps), 73. See also background processes

results, returning activities, 54-60

retreiving

data

from HttpUrlConnection, 280-281

from a Spinner, 163

objects from cursors, 269

RadioButtons, 166

returning results, activities, 54-60

right-to-left languages. See RTL languages

RippleDrawable class, 157

Roboto, 143

rotating images, 183-185

RTL (right-to-left) languages, 109

rules, filenames, 40

run() method, 75

running

apps in emulators, 23

on UI threads, 74

S

[top]

SaveInstanceState() method, 61-62

saving

app data, 239

files, external storage, 241

ScaleType property, 180-183

scrolling, horizontal, 174

ScrollView class, 177

SDKs (software development kits), 11, 48, 368-369

SecondActivity class, 20-21

SecondaryActivity class, 17

SeekBars class, 166-170

seekTo() method, 199

selection, handling, 224

sendBroadcast() method, 10

sending broadcasts, 7

sensors, applying, 370-371

Service class, 79. See also background processes

services

background processes, 79-87

development, 7-8

Google Play Services

applying, 361-364

locations, 364-367

starting, 6

setAlpha() method, 185

setAnchorView() method, 197

setAutoCancel() method, 338

setContentIntent() method, 341

setContentView() method, 54

setImageBitmap() method, 179

setImageDrawable() method, 179

setImageResource() method, 179

setImageUri() method, 179

setLargeIcon() method, 341

setOnClickListener() method, 74

setTextViewText() method, 344

Settings activity, generating, 256

SetTransition() method, 69

shadows, 141

SharedPreferences class

applying, 245

data types, 248

methods, 248

reading from, 246-248

storage, 245-248

user preferences, configuring, 249-257

sharing applications (apps), 382-384

showAsAction attribute, 209

showing. See viewing

Show Map buttons, adding, 30

signing

applications (apps), 378

up as developers, 278

SimpleCursorAdapter class, 271-274, 300

sizing. See also dimensions

resources, 44

text, 96

skeuomorphism, 139

sliding drawer navigation, 219-228

software development kits. See SDKs

specific locations, opening maps, 28

specifying

default resources, 50

language-specific resources, 51

URIs (Uniform Resource Identifiers), 311

Spinner class, 161-163, 217

SQL (Structured Query Language), 261

SQLite, 261

SQLiteOpenHelper class, 263-266

Square, 368

StartActivityForResult, 54-60

startActivity() method, 6, 195

starting

activities, 23

adding to start, 21-23

Intents class, 17-27

IntentService class from activities, 81

services, 6

video, 198

start() method, 199

startService() method, 81

statements, switch, 225

states

FABs (floating action buttons), 155

loaders, 325-330

ViewViews, listening for, 199-202

storage. See also file systems

files, 261

resources, 37, 40

SharedPreferences class, 245-248

stores, creating key, 381

strings, 37

adding, viewing in TextView, 94

applying, 41-42

definitions, 40

formatting, 41

resources, adding, 100

text, modifying, 94

<string> tag, 41

Structured Query Language. See SQL

structures, viewing projects, 38

styles. See also formatting

applying, 47-48

AppThemeNoActionBar, 216

customizing, 372

text, 96

subscreens, adding, 254

subscribing systems, 7

support

ad supported applications, 384

color formats, 43

SwitchPreference class, 252-253

switch statements, 225

SystemClock.sleep() method, 74

T

[top]

TableLayout class, 114

tables, managing, 261-262

tags

<color>, 42

<string>, 41

<uses-feature>, 377

testing

package files, 381

TV (Android), 357

Wear (Android) apps, 351

text

colors, modifying, 95

sizing, 96

strings, modifying, 94

styles, 96

textColor property, 95

TextView class, 37, 41

components

adding, 93

positioning, 93

parents, aligning to, 110

strings, viewing, 94

styles, applying, 48

UI (user interface) controls, 91

themes

configuring, 145

customizing, 372

threads, UI (user interface), 73-74

titles, adding, 254

toolbars

adding, 216

applying, 214-219

child views, adding, 217-219

tools, updating, 24

tracking locations, 365-367

troubleshooting connecting, 290-294

TV (Android), 347

AVD (Android Virtual Device), 356

developing, 355-357

as platforms, 347-348

testing, 357

types

layouts, 114-116

preferences, 251

of resources, 37

typography, 143

U

[top]

UIs (user interfaces), 5. See also interfaces

controls, 91

applying Android Studio, 91-92

creating buttons (for actions), 97-102

formatting, 18-19

input, handling, 92-96

reading/writing files, 236

threads, 73-74

updating, 19, 77

Uniform Resource Identifiers. See URIs

uninstalling package files, 382

update() method, 312, 318

updating

Android, 369

AndroidManifest.xml file, 80, 315

Calendar app, 307

data in databases, 266-267

tools, 24

UI (user interface), 19, 77

up navigation, 213

UriMatcher class, 314

URIs (Uniform Resource Identifiers), 297

defining, 312-319

specifying, formatting content providers, 311

user gestures, handling, 371

user input, handling, 92-96

user preferences, configuring, 249-257

<uses-feature> tag, applying, 377

V

[top]

values, 37, 209

versions, OS (operating systems), 4

videos

pausing, 198

playing, 195-199

positioning, 198

starting, 198

viewing, 195

VideoViews class, 195

applying, 196-197

audio, playing with MediaPlayer, 202-204

classes, 204

events, handling, 199-202

MediaController, adding, 197

video

pausing, 198

playing, 195-199

positioning, 198

starting, 198

ViewGroup controls, 372

viewing

activities, 18

Calendar apps, 300

data, 122

data display, 170-174

events, 305

images, 179-180

lists in fragments, 289

maps, 29-31

Options menu, 207-209

owner data, 332

ProgressBar, 78

projects, structures, 38

resources, applications (apps), 39

strings in TextView, 94

videos, 195

web pages, 31

View.post() method, applying, 76

views, 161, 174-177

child, 108. See also child views

modifying, 123-124

customizing, 372

holder patterns, implementing, 131-135

ListViews, overview of, 119-124

RelativeLayout, aligning, 110-112

ScrollView, 177

WebView, 174-177

W

[top]

wearable apps, 347

APIs (application programming interfaces), 353

design, 348

Wear (Android) apps, 347-354

AVD (Android Virtual Device), 351

notifications, adding, 353-354

testing, 351

WearDestinationActivity class, 353

WebView class, 174-177

weight, 115

where clauses, 267

Widgets, 91

WRITE_EXTERNAL_STORAGE permission, 235

writing app data, 237

X

[top]

XML files

layouts, editing, 107

RelativeLayout, 106