accelerometer, 393
accessing
Android Virtual Device Manager, 5
images, 53
ActionBar tabs for Photos and Favorites, 270-272
ACTION_EDIT, 296
ACTION_INSERT, 296
ACTION_INSERT_OR_EDIT, 296
ACTION_PICK, 296
ActionBar. See action bar
actions. See also action bar
in loaders, 247
activities. See also intents
CustomCameraActivity.java, 341-345
CustomVideoActivity.java, 345
fragment and activity interaction, 136-138
passing information between, 28
intents, 37
preference activities, generating, 183
SettingsActivity, creating, 183
starting
starting one activity from another, 20-25
starting IntentService from, 386
activity_main.xml file, 45
custom adapters, 253
custom CursorAdapters, 257
ListCursorAdapter
bindView() method, 264-266, 270
newView() method, 263
onClick() event handling, 269-270
sync adapters, 285
Add() method, 130
AddToBackStack() method, 131
ad-supported apps, 409
ADT (Android Developer Tools) bundle
folder structure, 4
custom views, 154
custom views, 154
alerts, ProximityAlerts, 311-312
alpha level, 353
Amazon, publishing apps on, 408
Android 4.2 folder, 44
Android Beam, 396
Android Compatibility package, 70-71
Android dependencies folder, 44, 46
Android developer documentation, 393
Android Developer Tools bundle. See ADT (Android Developer Tools) bundle
Android Device Chooser, 73
Android Studio, 3
strategy for device support, 72
table of, 68
Android Virtual Device. See AVD (Android Virtual Device)
Android Virtual Device Manager, accessing, 5
AndroidManifest.xml file, 43
content providers, 231
Facebook apps, 372
intent filters, 35
preparing for release, 400-401
service definitions, 385
animations, adding, 55, 388-390
APIs (Application Programming Interfaces), 189
API levels, 68
Calendar Content Provider, 285-288
calendar events, listing, 289-292
calendar updates with intents, 293
CalendarContract tables, 284
event data, accessing, 292-293
ContactsContract class, 294-295
Maps API, 311
remote APIs, 189
background downloads with AsyncTask, 197-200
connectivity, checking, 202
lists, displaying in fragments, 200
remote data, fetching, 190-193
in-app payments, 410
Application Programming Interfaces (APIs). See APIs (Application Programming Interfaces)
application resources, referencing, 47-48
apps
ad-supported apps, 409
APIs (Application Programming Interfaces). See APIs (Application Programming Interfaces)
in-app payments, 410
Bluetooth support, 396
camera app, 338
associating camera with SurfaceView, 339-340
CustomCameraActivity.java, 341-345
CustomVideoActivity.java, 345
permissions for capturing media, 338
SurfaceHolder.Callback implementation, 340
development
determining app functionality, 259-263
Facebook photo upload app
app IDs, 372
Facebook permissions, 373
login and session management, 374
Flickr app. See Flickr app
free apps, 409
internationalization strategies
forgoing app internationalization, 324-325
implementing robust internationalization, 325-326
limiting app internationlization, 325
launching
with intents, 38
NFC (Near Field Communication), 396
open source
ActionBarSherlock, 391
including in apps, 392
ViewPageIndicator, 391
OpenGL ES graphics API, 395
paid apps, 409
preparing for release, 399
Android manifest file, 400-401
projects
files at project creation, 43-45
folders at project creation, 43-45
publishing, 405
on Amazon, 408
OUYA and other markets, 409
responsive apps with IntentService, 383-388
reviewing in multiple languages, 322
sensors, 393
certificate file export, 404-405
with command-line tools, 403-404
with Eclipse, 402
package testing, 405
speech to text conversion, 395
text to speech (TTS) conversion, 395
user interface. See user interface
views. See views
arrays, JSONArrays, 195
associating camera with SurfaceView, 339-340
AsyncTask class, 108-109, 197-200
AsyncTaskLoader class, 246
attendees (event), returning list of, 292
audio, playing with MediaPlayer, 361
AudioFocus class, 362
AudioManager class, 362
AudioTrack class, 362
AutoCompleteTextView, 106
AVD (Android Virtual Device), creating, 5, 11-12
avoiding OOM (out of memory) exception, 353-355
background downloads with AsyncTask, 197-200
Beam, 396
bin folder, 45
bindView() method, 257, 264-266, 270
BitmapFactory class, 353
BitmapFactoryOptions class, 354-355
Bluetooth support, 396
build dependencies, resolving, 370
bundles, adding to intent, 28-30
cached images, saving, 222-224
Calendar Content Provider, 285-288
calendar events, listing, 289-292
calendar updates with intents, 293
CalendarContract tables, 284
event data, accessing, 292-293
Calendar Content Provider, 285-288
calendar events, listing, 289-292
CalendarContract tables, 284
CalendarListFragment, 286
camera app, 338
associating camera with SurfaceView, 339-340
CustomCameraActivity.java, 341-345
CustomVideoActivity.java, 345
permissions for capturing media, 338
SurfaceHolder.Callback implementation, 340
CameraPreview class, 338-340, 341-343
camera app, 338
associating camera with SurfaceView, 339-340
CustomCameraActivity.java, 341-345
CustomVideoActivity.java, 345
permissions for capturing media, 338
SurfaceHolder.Callback implementation, 340
intents
advantages of, 338
launching with intents, 333-334
media scanner, invoking, 331-332
media storage file, specifying, 330-331
URIs (Uniform Resource Identifiers), creating, 331-332
media scanner, invoking, 331-332
media storage file, specifying, 330-331
photos. See photos
URIs (Uniform Resource Identifiers), creating, 331-332
certificate file, exporting, 404-405
changing
LinearLayout control properties, 85-86
locales, 319
checking connectivity, 202
child views
gravity, 88
layout margins, 87
weight, 88
classes. See individual classes
closing dialogs, 144
cloud access. See remote APIs
colors, 50
command-line tools
Commit() method, 131
compress() method, 224
connectivity, checking, 202
constants, creating, 30
ContactListFragment, 296
ContactsContract class, 294-295
Contacts table, 295
ContactsContract class, 294-295
contains() method, 173
content providers, 227
AndroidManifest.xml file, 231
delete() method, 235
update() method, 235
requesting files from, 237-242
file support implementation, 238-239
Uniform Resource Identifiers (URIs), 227-228
controls
input controls, 98
FrameLayout, 89
getting data from, 106
setting up, 105
converting
speech to text, 395
text to speech, 395
createBitmap() methods, 356
createLoader() method, 247
criteria for location providers, 302-303
currencies, handling, 327
Currency class, 327
CursorAdapter
with CursorLoader class, 248-252
ListCursorAdapter
bindView() method, 264-266, 270
newView() method, 263
CursorLoader class
overview, 246
custom adapters, 253
custom CursorAdapters, 257
ListCursorAdapter
bindView() method, 264-266, 270
newView() method, 263
onClick() event handling, 269-270
custom buttons, 103
custom view controls, 395
custom views
in alert dialogs, 154
CustomCameraActivity.java, 341-345
CustomVideoActivity.java, 345
data access
content providers, 227
requesting files from, 237-242
Uniform Resource Identifiers (URIs), 227-228
custom adapters, 253
custom CursorAdapters, 257
loaders
actions, 247
creating, 247
CursorLoader with CursorAdapter, 248-252
explained, 245
initializing, 247
loader classes, 246
resetting, 248
remote APIs, 189
background downloads with AsyncTask, 197-200
connectivity, checking, 202
lists, displaying in fragments, 200
remote data, fetching, 190-193
SQLite databases. See SQLite databases
Data table, 295
data types in SharedPreferences, 173-174
DatabaseHelper class, 207
databases (SQLite). See SQLite databases
date strings, formatting, 326
DateFormat class, 326
declarations for content providers, 229-230
decodeResource() method, 353
decodeStream() method, 224, 353
deep linking, 378
default resources, specifying, 321
defining IntentService, 385-386
DelayReceiver, 388
delete() method, 235
deleting photos from database, 211-212
density (screen)
density-independent pixels, 61
explained, 60
designing layouts, 80
detecting device features, 67
criteria for location providers, 302-303
Location object, 302
location settings, 305
developer documentation, 393
developing apps
determining app functionality, 259-263
Facebook development, 366
devices
display, 60
platform versions and compatibility levels
strategy for device support, 72
table of Android versions, 68
dialogs
custom views, 154
closing, 144
opening, 144
ProgessDialog, 146
dismiss() method, 143
display, 60
orientation
explained, 65
handling, 65
screen density
explained, 60
screen size
explained, 61
displaying
fragments
photos
ImageViews, 348
displays, external, 396
documentation (Android), 393
doInBackground() method, 198-199, 223
Dom parser, 202
dots-per-inch (DPI), 61
downloading Facebook SDK, 368
DPI (dots-per-inch), 61
in buttons, 102
images
accessing, 53
supported image formats, 52
ninepatch, 52
drop-down navigation, action bar, 120-121
Eclipse
Eclipse folder, 4
signing apps, 402
editing layouts, 81
EditTextPreference, 179
elements
<include/>, 82
<support-screens>, 63
<uses-feature>, 67
event handling, user gestures, 394
events, calendar events, listing, 289-292
explicit intents, 34
exporting certificate file, 404-405
external display, Presentation class, 396
extras
accessing from intent, 29
naming conventions, 30
Facebook apps
app IDs, 372
Facebook photo upload app
app IDs, 372
Facebook permissions, 373
login and session management, 374
Facebook SDK, 365
deep linking, 378
downloading, 368
Facebook development websites, 366
Facebook photo upload app
app IDs, 372
Facebook permissions, 373
login and session management, 374
including in projects, 370-373
libraries, creating, 379
overview, 378
fade-in animations, 55
fadein.xml file, 55
features of devices, detecting, 67-68
fetchFavorites() method, 212
fetching remote data, 190
app structure, 193
files
activity_main.xml, 45
AndroidManifest.xml, 43
AndroidManifest.xml file
content providers, 231
Facebook apps, 372
preparing for release, 400-401
service definitions, 385
certificate file, exporting, 404-405
fadein.xml, 55
Ic_launcher-web.png, 45
image files, saving, 218
retrieving item from Flickr, 221-222
MainActivity.java, 44
media storage file, specifying, 330-331
MP3 audio files, playing with MediaPlayer, 361
Proguard-project.txt, 45
project.properties, 45
requesting from content providers, 237-242
file support implementation, 238-239
resource files. See resources
strings.xml, 45
styles.xml, 45
filters (intent), 35
findViewById() method, 81
FiveSecondService.java, 385
Flickr app. See also SQLite databases
background downloads with AsyncTask, 197-200
content providers
requesting files from, 237-242
Uniform Resource Identifiers (URIs), 227-228
custom adapters, 253
development
determining app functionality, 259-263
final app inventory, 277
ListCursorAdapter
bindView() method, 264-266, 270
newView() method, 263
onClick() event handling, 269-270
lists, displaying in fragments, 200
loaders
actions, 247
creating, 247
CursorLoader with CursorAdapter, 248-252
explained, 245
initializing, 247
loader classes, 246
resetting, 248
Photo and Favorite photo fragments, 270-272
photos
displaying in list or grid, 272-275
displaying single image, 275-276
getting from database, 212-215
inserting into database, 209-210, 215-216
retrieving from Flickr, 221-222
remote data, fetching, 190-193
retrieving items from, 221-222
FlickrPhoto class, 196-197, 206
FlickrPhotoDbAdapter class, 206-209, 215
AndroidManifest.xml file, 231
delete() method, 235
update() method, 235
requesting files from, 237-242
file support implementation, 238-239
Uniform Resource Identifiers (URIs), 227-228
folders
Android 4.2, 44
Android dependencies folder, 44, 46
bin, 45
drawable-*, 45
Eclipse, 4
libs, 44
sdk, 4
src, 44
forgoing app internationalization, 324-325
formatting date and time strings, 326
FormControlActivity class, 100
CalendarListFragment, 286
ContactListFragment, 296
content providers, adding, 236-237
displaying
fragment and activity interaction, 136-138
ListFragments, 157
lists in, 200
Photo and Favorite photo fragments, 270-272
PhotoGridFragment, 251-252, 272-275
PhotoListFragment, 200, 216-218, 272-274
PreferencesFragment
EditTextPreference, 179
reading preferences, 182
support package, 131
FragmentTransaction object, 130-131
free apps, 409
Froyo, 68
generating preference activities, 183
gestures, 394
getActivity() method, 134
getAll() method, 173
getArguments() method, 138
getBoolean() method, 172
getCacheDir() method, 220
getColor() method, 50
getColumnIndex() method, 214
getConfiguration() method, 326
getContentResolver() method, 277
getCount() method, 253
getDialog() method, 142
getDrawable() method, 53
getExternalFilesDir() method, 220
getExternalStorageDirectory() method, 220
getExternalStoragePublicDirectory() method, 220, 330-331
getFilesDir() method, 220
getFloat() method, 173
getFromLocation() method, 308
getFromLocationName() method, 307
getItem() method, 253
getItemId() method, 253
getLastKnownLocation() method, 303
getLatitude() method, 307
getLoaderManager() method, 247
getLocality() method, 309
getLong() method, 173
getLongitude() method, 307
getPackageManager() method, 67-68
getPhotoFromCursor() method, 218
getPhotos() method, 197
getRecentLocation() method, 304
getSelectedItem() method, 106
getSelectedItemPosition() method, 106
getSharedPreferences() method, 171-172
getStringSet() method, 173
getSupportFragmentManager() method, 131
getSystem() method, 48
getTime() method, 304
getView() method, 253, 255-256
getWriteableDatabase() method, 208-209
Gingerbread, 68
global positioning system. See GPS (global positioning system)
Google Play, publishing apps to, 405-408
Google Street View support, 310
Google TV, 60
GPS (global positioning system), 299. See also location-based services
determining location
criteria for location providers, 302-303
Location object, 302
location settings, 305
Maps API, 311
graphics
OpenGL ES graphics API, 395
photos. See photos
gravity, 88
Groups table, 295
Gson, 196
hiding images from media scanner, 331
hint property (EditText control), 98
hints, showing in EditText view, 98
Honeycomb, 68
HorizontalScrollView, 168
HTC Dream phone, 59
Ic_launcher-web.png file, 45
Ice Cream Sandwich, 68
icons, adding to menu items, 117
IDs (app), 372
image files, saving, 218
retrieving item from Flickr, 221-222
images
accessing, 53
image files, saving, 218
retrieving item from Flickr, 221-222
alpha level, 353
displaying images, 348
photos. See photos
supported image formats, 52
alpha level, 353
displaying images, 348
<include/> element, 82
initializing loaders, 247
initLoader() method, 247
inJustDecodeBounds option (BitmapFactoryOptions), 354
input controls, 98
inputStreamToString() method, 56
inputType property (EditText control), 99
inSampleSize option (BitmapFactoryOptions), 354
installing Facebook SDK, 368-370
IntelliJ, 3
ACTION_SEND intent, handling, 35-37
advantages of, 338
creating, 22
explicit intents, 34
extras
accessing, 29
naming conventions, 30
intent filters, 35
launching apps with, 38
launching cameras with, 333-334
passing information with, 37
updating calendar with, 293
IntentService
starting from activity, 386
interfaces
onDateEnteredListener, 149
internationalization, 323-324. See also localization
strategies
forgoing app internationalization, 324-325
implementing robust internationalization, 325-326
limiting app internationlization, 325
isOnline() method, 202
Jelly Bean, 68
JSONArrays, 195
JSON-formatted data, 194
JSONArrays, 195
JSONObjects, 194
JsonReader, 195
JSONObjects, 194
JsonReader, 195
language-specific resources, specifying, 321
large images, handling, 353-355
last known location, determining, 303-305
with intents, 38
Layout Resource Editor, 80
layout_gravity property, 88
layout_weight property, 88
layouts
gravity, 88
layout margins, 87
weight, 88
designing, 80
editing, 81
Layout Resource Editor, 80
common attributes, 84
RelativeLayout control, 82, 89-91
TableLayout control, 82
using programmatically, 81
VideoViews, 357
libraries
ActionBarSherlock, 391
creating, 379
Facebook SDK. See Facebook SDK
Gson, 196
ViewPageIndicator, 391
libs folder, 44
lifecycle
of services, 383
light sensor, 393
limiting app internationlization, 325
common attributes, 84
links, deep linking, 378
ListCursorAdapter
bindView() method, 264-266, 270
newView() method, 263
onClick() event handling, 269-270
ListFragments, 157
PhotoListFragment, 200, 216-218, 236-237
listing calendar events, 289-292
lists
CalendarListFragment, 286
ContactListFragment, 296
displaying in fragments, 200
ListFragments, 157
PhotoListFragment, 200, 216-218
Loader class, 246
LoaderManager class, 246
LoaderManagerCallbacks class, 246
loaders
actions, 247
creating, 247
CursorLoader with CursorAdapter, 248-252
explained, 245
initializing, 247
loader classes, 246
resetting, 248
LoadImage() method, 222
loading
video, 358
locales
changing, 319
default resources, 321
determining system locale, 325-326
explained, 317
localization, 317
Android support for, 318
currencies, handling, 327
date and time string formatting, 326
general internationalization principles, 317-318
internationalization strategies, 323-324
forgoing app internationalization, 324-325
implementing robust internationalization, 325-326
limiting app internationlization, 325
language-specific resources, specifying, 321
locales
changing, 319
default resources, 321
determining system locale, 326
explained, 317
region-specific resources, specifying, 322
reviewing apps in multiple languages, 322
Location object, 302
location providers, criteria for, 302-303
location settings, 305
location-based services, 299
criteria for location providers, 302-303
Location object, 302
location settings, 305
Maps API, 311
logcat, monitoring, 12
login management (Facebook apps), 374
magnetic field sensor, 393
MainActivity.java file, 44
makePhotoList() method, 197
Manifest file
content providers, 231
Facebook apps, 372
intent filters, 35
preparing for release, 400-401
service definitions, 385
Maps API, 311
margins, child views, 87
Android classes, 362
audio, playing with MediaPlayer, 361
media scanner, invoking, 331-332
media storage file, specifying, 330-331
URIs (Uniform Resource Identifiers), creating, 331-332
ImageViews, 347
alpha level, 353
displaying images, 348
MediaController, 359
photos. See photos
VideoViews
layout, 357
loading video, 358
starting, pausing, and positioning video, 358
media scanner, invoking, 331-332
media storage file, specifying, 330-331
MediaController, 359
MediaStore, 329
menus, options menus, 113
adding icons to, 117
methods. See individual methods
Miracast, 396
monitoring logcat, 12
moveToFirst() method, 214
moveToLast() method, 214
moveToNext() method, 214
moveToPosition() method, 214
moveToPrevious() method, 214
MP3 audio files, playing with MediaPlayer, 361
naming conventions
extras, 30
packages, 7
navigation
action bar
fragments
navigating between fragments, 132-134
options menus, 113
Near Field Communication (NFC), 396
NFC (Near Field Communication), 396
ninepatch, 52
notifyChange() method, 219
ODK (OUYA Developer Kit), 409
onActivityCreated() method, 163, 236-237, 240-241, 290
onActivityResult() method, 332, 335-336, 337-338
onAnswerSelected() method, 138
onAnswerSelectedListener() method, 136-137
onClick() method, 17
onClickListener() method, 17, 336-337
onCompletionListener() method, 358-359
onConfigurationChanged() method, 66-67
onCreate() method, 10, 24-25, 39-40, 207, 293
onCreateDialog() method, 142, 150, 154
onCreateLoader() method, 246, 272, 275, 287, 291
onCreateOptionsMenu() method, 10, 114-119
onCreateView() method, 159-167
onDateEnteredListener interface, 149
onDoubleTap, 394
onDoubleTapEvent, 394
onDown, 394
onFling, 394
onHandleIntent() method, 383
onListItemClick() method, 159, 218, 288
onLoaderReset() method, 246, 248, 287
onLoadFinished() method, 246, 247, 275, 287
onLocationChanged() method, 300-301, 308
onLongPress, 394
onNavigationListener interface, 120-121
onOptionsItemsSelected() method, 119-120
onPause() method, 39-40, 361, 387
onPostExecute() method, 199-200
onPreparedListener() method, 358-359
onResume() method, 39-40, 361, 387
onScroll, 394
onSessionStateChanged() method, 374
onShowPress, 394
onSingleTapConfirmed, 394
onSingleTapUp, 394
onUpgrade() method, 207
OOM (out of memory) exception, avoiding, 353-355
open source
ActionBarSherlock, 391
in apps, 392
ViewPageIndicator, 391
openFile() method, 238
openFileInput() method, 219
OpenGL ES graphics API, 395
opening dialogs, 144
openRawResource() method, 56
options menus, 113
adding icons to, 117
retaining data across configuration changes, 66
orientation sensor, 393
out of memory (OOM) exception, avoiding, 353-355
outHeight option (BitmapFactoryOptions), 354
outWidth option (BitmapFactoryOptions), 354
OUYA Developer Kit (ODK), 409
packages
names, 7
testing, 405
paid apps, 409
ParcelFileDescriptor, 239
parsing JSON-formatted data, 196-197
passing information between activities, 28
intents, 37
pausing video, 358
permissions (Facebook), 373
permissions for capturing media, 338
personalizing
PhoneLookups table, 295
photoDbAdapter variable, 215
PhotoGridFragment, 251-252, 272-275
PhotoListFragment, 200, 216-218, 236-237, 272-274
ActionBar tabs for Photos and Favorites, 270-272
alpha level, 353
displaying
ImageViews, 348
photo titles from database, 216-218
Facebook photo upload app
Facebook permissions, 373
login and session management, 374
getting from database, 212-215
image files, saving, 218
retrieving item from Flickr, 221-222
inserting into database, 209-210, 215-216
loading with ListCursorAdapter, 267-269
retrieving from Flickr, 221-222
retrieving from FlickrPhotoProvider, 239-241
taking, with camera app, 343-345
PictureCallback() method, 344
platform tools, 5
platform versions and compatibility levels
strategy for device support, 72
table of Android versions, 68
playing audio with MediaPlayer, 361
positioning video, 358
preference activities, generating, 183
preferences, 171
SharedPreferences, 171
user preferences, 174
EditTextPreference, 179
preference activities, 183
PreferencesFragment, creating, 174-175
reading, 182
EditTextPreference, 179
reading preferences, 182
preparing for release, 399
Android manifest file, 400-401
certificate file export, 404-405
with command-line tools, 403-404
with Eclipse, 402
package testing, 405
previews, displaying (camera), 341-343
ProgessDialog, 146
Proguard-project.txt file, 45
project.properties file, 45
projects
Android dependencies folder, 46
files
files at project creation, 43-45
folders at project creation, 43-45
resources, 47
advantages of, 47
animations, 55
application resources, referencing, 47-48
colors, 50
ninepatch, 52
raw resource files, 56
storing in assets folder, 56-57
strings, 49
system resources, referencing, 48
proximity sensor, 393
publishing apps, 405
on Amazon, 408
OUYA and other markets, 409
putExtra() method, 37, 293, 387
querying
raw resource files, 56
RawContacts table, 295
reading
user preferences, 182
RECORD_AUDIO permission, 338
recurring event definitions, 291
referencing
system resources, 48
region-specific resources, specifying, 322
registerOnSharedPreferenceChangeListener() method, 174
registerReceiver() method, 388
RelativeLayout control, 82-83, 89-91
release, preparing apps for, 399
Android manifest file, 400-401
certificate file export, 404-405
with command-line tools, 403-404
with Eclipse, 402
package testing, 405
remote APIs, 189
background downloads with AsyncTask, 197-200
connectivity, checking, 202
JSON-formatted data, 194
JSONArrays, 195
JSONObjects, 194
JsonReader, 195
lists, displaying in fragments, 200
remote data, fetching, 190
app structure, 193
remote data, fetching, 190
app structure, 193
Remove() method, 130
removeUpdates() method, 305
Replace() method, 130
requesting files from content providers, 237-242
file support implementation, 238-239
requestLocationUpdates() method, 305
reset() method, 361
resetting loaders, 248
resolving build dependencies, 370
advantages of, 47
animations, adding, 55
application resources, referencing, 47-48
in buttons, 102
colors, 50
default resources, specifying, 321
images
accessing, 53
supported image formats, 52
language-specific resources, specifying, 321
ninepatch, 52
raw resource files, 56
region-specific resources, specifying, 322
storing in assets folder, 56-57
strings, 49
system resources, referencing, 48
RetrieveImage() method, 239-240
retrieving item from Flickr, 221-222
reviewing apps in multiple languages, 322
robust internationalization, 325-326
Run Configurations screen, 74
running. See launching
saving image files, 218
retrieving item from Flickr, 221-222
SAX parser, 202
screen density
explained, 60
screen size
explained, 61
<support-screens> element, 63
sdk folder, 4
sendBroadcast() method, 331, 386-388
sensors, 393
services
explained, 383
IntentService
starting from activity, 386
lifecycle, 383
location-based services, 299
translation services, 322
session management (Facebook apps), 374
setCompoundDrawablesWithIntrinsicBounds() method, 102
setContentView() method, 46, 81
setData() method, 331
setImageAlpha() method, 353
setImageBitmap() method, 348
setImageDrawable() method, 348
setImageResource() method, 348
setImageUri() method, 348
setItems() method, 153
setMessage() method, 153
setOutputFile() method, 345
setScaleType() method, 351
setText() method, 102
setting preferences, SharedPreferences, 171-172
SettingsActivity, creating, 183
setTitle() method, 153
SetTransition() method, 131
SharedPreferences, 171
show() method, 144
showAsAction attribute (onCreateOptionsMenu() method), 115-116
showFragmentA() method, 132-134
showFragmentB() method, 132-134
showGrid() method, 273
showList() method, 200, 271, 273
certificate file export, 404-405
with command-line tools, 403-404
package testing, 405
simple resources
colors, 50
strings, 49
SimpleDateFormat() method, 331
size of screen
explained, 61
SoundPool class, 362
specifying
default resources, 321
language-specific resources, 321
region-specific resources, 322
speech to text conversion, 395
getting data from, 106
setting up, 105
SQLite databases, 205
photos
src folder, 44
StartActivityForResult() method, 30-33, 332, 375
starting
activities
starting one activity from another, 20-25
IntentService, 386
video, 358
startService() method, 386
states, loader states, 246-252
StatusUpdates table, 295
strings
data and time string formatting, 326
explained, 49
strings.xml file, 45
styles.xml file, 45
<support-screens> element, 63
surfaceChanged() method, 340
surfaceCreated() method, 340
surfaceDestroyed() method, 340
SurfaceHolder.Callback implementation, 340
SurfaceView, associating camera with, 339-340
sync adapters, 285
system locale, determining, 325-326
system resources, referencing, 48
tab navigation, action bar, 122-124
TableLayout control, 82
CalendarContract tables, 284
ContactsContract tables, 295
taking photos
taking video. See capturing media
temperature sensor, 393
testing packages, 405
text to speech (TTS) conversion, 395
time strings, formatting, 326
titles, adding to user preferences, 180-181
translation services, 322
T-Store, 409
UiLifecycleHelper, 374
Uniform Resource Identifiers (URIs), 227-228, 331-332
unregisterOnSharedPreferenceChangeListener() method, 174
unregisterReceiver() method, 388
update() method, 235
updating
calendar with intents, 293
uploads, Facebook photo upload app
Facebook permissions, 373
login and session management, 374
Uri.fromFile() method, 331
URIs (Uniform Resource Identifiers), 227-228, 331-332
Uri.withAppendedPath() method, 275
user gestures, 394
user interface. See also views
action bar, 120
AutoCompleteTextView, 106
dialogs
closing, 144
opening, 144
ProgessDialog, 146
fragments
displaying dynamically, 129-131
displaying with layouts, 128-129
fragment and activity interaction, 136-138
support package, 131
ImageViews, 110
input controls, 98
layouts
designing, 80
editing, 81
Layout Resource Editor, 80
RelativeLayout control, 82, 89-91
TableLayout control, 82
using programmatically, 81
ListFragments
options menus, 113
adding icons to, 117
getting data from, 106
setting up, 105
user gestures, 394
user preferences, 174
EditTextPreference, 179
preference activities, 183
PreferencesFragment, creating, 174-175
reading, 182
<uses-feature>, 401
<uses-feature> element, 67
versions of Android
strategy for device support, 72
table of, 68
video
capturing with intents, 336-338
CustomVideoActivity.java, 345
loading, 358
starting, pausing, and positioning, 358
VideoViews
layout, 357
loading video, 358
starting, pausing, and positioning video, 358
ViewFlipper, 168
ViewGroup controls, customizing, 395
ViewPageIndicator, 391
ViewPager, 168
AutoCompleteTextView, 106
custom view controls, 395
custom views in alert dialogs, 154
HorizontalScrollView, 168
ImageView, 110
ImageViews, 347
alpha level, 353
displaying images, 348
starting, pausing, and positioning video, 358
SurfaceView, associating camera with, 339-340
VideoViews
layout, 357
loading video, 358
ViewFlipper, 168
ViewPager, 168
virtual devices. See AVD (Android Virtual Device)
visual editor, 97
weight (child views), 88
Wharton, Jake, 391
WRITE_EXTERNAL_STORAGE permission, 338
XMLPullParser, 202
18.223.237.29