A

AbsoluteLayout layout manager, 141-142

AbstractRenderer class, 343

AbstractRenderer source code (OpenGL), 396-397

AbstractRenderer.java, 345, 354-355 ACTION_GET_CONTENT action, 104-105 ACTION_PICK action, 102-104 actions, generic, 95 activities activity.onCreateContextMenu() method, 165

activity.registerForContextMenu(view)

method, 166 adding animation to, 201-204 categories, 100

code for layout animation, 207-208 components to invoke, 97-98 creating, 199-200, 206-208 defined, 10, 24 lifecycle methods of, 39 live folders and, 410 state transitions of, 40-41 adapters, Android, 146-149 Adaptive Multi-Rate (AMR) narrowband audio codec, 315-316 addRegularMenuItems function, 159-160 ADT (Android Development Tools), installing, 22-24

ADT plug-in for Eclipse, 226, 228, 238-239

AIDL (Android Interface Definition Language) services calling from client applications, 288-291 defining service interface in, 283-286 implementing interface, 283-286 overview, 282-283 passing complex types to, 292-299 alert-dialogs builder, 180-181 designing, 177-178 AllContactsLiveFolderCreatorActivity.java,

412-414 alpha animation, 204, 211 alphabeticShortcut tags, menu (XML), 176 alternative menus, 168-172 AnalogClock control, 129-130 Android

1.0 SDK, downloading, 22 1.1/1.5, installing, 22 android.app.Application class, 40-41 android.app.Service public methods,

277-278 android.appwidget, 15 android.jar file, 19 android.location package, 238, 249 android.location.Geocoder class, 249

AndroidManifest.xml (live folders), 25, 29, 162-163, 411-412

android.media package, 301

android.media.MediaRecorder class, 311

android.os.Debug class, 41

android.preference.ListPreference,

365-366

android. preference.PreferenceActivity class, 367 android.util.Log, 41-42

android.view.animation package, 205 android.view.animation.Animation class, 217

android.view.Layoutlnflater class, 180-181 android.view.Menu class, 151 android.view.MenuInflater class, 173 android.widget.Button class, 117 Asset Packaging Tool (AAPT), 30, 49 Dev Phone (Google), 4, 422 interfacing with OpenGL ES, 338-342 Market, 227

MIME types structure, 69-71 SDK, 9, 41, 301

Software Development Kit (SDK), 21 Virtual Device (AVD), creating, 383-384 Android 1.5 SDK

Android Virtual Device (AVD), creating,

383-384

android.bat tool parameters, 383 creating new application, 379-382 downloading, 377 features, 422-423

input-method framework (IMF), 394 installing ADT plug-in for, 377-379

MediaRecorder class for video capture,

384-386

MediaStore class, 386-390

online resources for, 423

scanning media store for content, 390-392

voice recognition, 392-393

Android applications debugging, 41-42

lifecycle of, 38-41

structure of, 28-30

Android Platform advanced UI concepts, 12-13

Android emulator, 9-10

Dalvik VM, 4-5

foundational components, 11

future of, 421-423

history of, 3-4

Java packages in Android SDK, 15-18 media and telephony components, 14-15 overview, 1-2 service components, 13 software stack, 8-9 source code, 18 UI framework, 10 AnimatedSimpleTriangleRenderer.java, 402-404

AnimatedTriangleActivity.java, 401-402 animation

AnimationDrawable class, 197, 201 AnimationListener class, 221-222 example (OpenGL), 401-404 supported types, 12 animation, 2D

frame-by frame animation, 198-204 layout animation. See layout animation overview, 197

view animation. See view animation APIs mapping, 238-249 media. See media APIs telephony. See telephony APIs .apk files, 228-229, 301 applications

Android 1.5, building, 379-382 application preferences, defined, 363 installing updates and signing, 229 signing for deployment, 226-229 appwidget classes, 15 architecture of content providers, 67-68 ARM (Advanced RISC Machine), 10 ArrayAdapter, 147-148 artifacts of Android applications, 29-30 AssetManager class, 59 assets directory (resources), 59 attributes android.preference.ListPreference,

365-366 gravity, 134

audio files, playing (examples), 14 recording, 311-316 recording with intents, 386-388 authority, defined (content providers), 68 AutoCompleteTextView control, 115-116 AVD (Android Virtual Device), creating, 383-384

background threads, geocoding with,

253-256 Bellard, Fabrice, 10

BetterCursorWrapper.java (live folders),

419-420 bindService() method, 291 Bornstein, Dan, 5 boundaries, process, 229-230 bounding volume (box), 330-331 built-in content providers, 61-62 button controls, 117-122 buttons and listeners, setting up, 181

callbacks, incorporation in dialogs, 184-185

camera and coordinates (OpenGL), 334-338

Camera class for depth perception, 220-221

camera settings, changing (OpenGL test harness), 358-359

camera symbolism, 335-336

categories, intent, 99-101

categories of preferences, creating, 375-376

certificate authority (CA), 226

certificates, self-signed, 226-228

checkableBehavior tags (XML), 175

CheckBox control, 119-120

CheckBoxPreference, 367-369

classes for defining constants, 99

click events, 117-118

client applications, calling AIDL services from, 288-291 code, building UI in, 108-111 color (glColor), 334 color resources, 51, 55-57 COM (Component Object Model), 326-327 com.google.android.maps package, 238 Commons IO, Apache, 267 compiled/noncompiled resources, 48-49 complex types, passing to services, 292-299 components to invoke activities, 97-98 rules for resolving intents to, 102 Connected Limited Device Configuration

(CLDC), 5-7 connection timeouts, 269 constants, classes for defining, 99 container view, defined, 108 content providers adding files to, 77-78 Android content URIs, 68-69 Android cursors, 73-74 Android MIME types structure, 69-71 architecture of, 67-68 built-in, 61-62 ContentProvider class, 81-83 databases, planning, 79-81 defined, 11, 25 delete method, 87-88 explicit WHERE clauses, 75-76 fundamentals, 60-61 insert method, 85-87 inserting records, 76-77 live folders and, 410 MIME-type contracts, fulfilling, 83-84 passing WHERE clauses, 74-75 projection maps, 90 query method, 84-85 reading data with URIs, 71-73 registering content provider, 90-91 steps, 79

update method, 87 updates and deletes, 78-79 UriMatcher class, 88-90

content URIs, 36

ContentValues/ ContentResolver classes, 76-78

context menus, 165-168 continuous rendering mode (OpenGL), 401 contracts, fulfilling MIME-type, 83-84 controls, Android button controls, 117-122 date/time controls, 128-130 Gallery control, 130-131 grid controls, 126-127 list controls, 122-126 MapView control, 130 text controls, 113-117 coordinates (OpenGL ES), 329-331 coordinates, world, 330-331, 335 CORBA (Common Object Request Broker

Architecture), 326-327 cursors, Android, 72-74, 418-419 custom adapters, creating, 148-149 custom permissions, 232-238 custom resource IDs, 48

customizing layout for screen configurations, 145-146

Dalvik

Debug Monitor Service (DDMS), 260261, 310 VM overview, 4-5 data reading with URIs, 71-73 responding to changing (menus), 172 returning after invoking actions, 103-104 URIs, intents and, 94 databases

DatabaseHelper class, 37-38 exploring on emulator, 62-66 planning, 79-81 DatePicker control, 128-129 date/time controls, 128-130

debugging

Android applications, 41-42 debug certificates, 239-240 layouts with Hierarchy Viewer, 149-150 delete method, 87-88 deletes and updates, 78-79 deployment of live folders through Eclipse, 421 signing applications for, 226-229 DialogRegistry class, 192 dialogs, Android alert dialogs, designing, 177-178 incorporation of callbacks in, 184-185 managed dialogs. See managed dialogs overview, 176-177

prompt dialogs, designing, 179-184, 185 digital certificates, 226 DigitalClock control, 129-130 dimension resources, 53-54 dimension types supported, 138-139 Direct3D standard, 326-327 directory structure, 60 DirectX API, Microsoft, 326 downloading

Android SDK 1.0, 22 Eclipse IDE for Java Developers, 22 JDK 6, 21-22 drawing

Drawable class, 201 with OpenGL ES, 329-330 simple triangle, 356-357 surfaces, 334, 340-341 vertices, 330-332

Eclipse deploying live folders through, 421 Eclipse 3.4, 377

IDE for Java Developers, 22, 27 installing ADT plug-in for, 377-379

EditText control, 115, 136-138 EditTextPreference, 370-371 EGL Graphics Interface context, 338-341 EglHelper.java, 352-354 overview, 327-328 EglHelper utility class, 343 EglHelper.java, 345 e-mail, 322-323 emulators

Android, 9-10

exploring databases on, 62-66 passing command-line arguments to, 309

sending SMS messages to, 320

enabled tags, menu (XML), 176

entry-point activity, 32

exceptions with HTTP services, 269-271

expanded menus, 163

extending ContentProvider class, 81-83

extension of android.app.Application class, 40-41

extras (intent attributes), 96-97 eye points, 335-336

far points, 337 files adding to content providers, 77-78 FileDescriptors, 306 flight-options example (preferences),

363-367 folders, SMS, 321-322 for loops, 74

foundational components, Android, 11 frame-by frame animation, 12, 197-204 FrameLayout layout manager, 143-144 FreeType library, 9 frustum, defined, 325

Gallery control, 130-131

gen subdirectory (R. Java), 44 generic actions, 95 GenericManagedAlertDialog, 194 GenericPromptDialog class, 195 geocoding with background threads, 253-256 Geocoder class, 250-252 overview, 249-250

to points with location names, 252-253 GeoPoint class, 248 GET Requests, HTTP, 264-265 GET_CONTENT action, 104-105 getApplication() method, 277 getIntent() method, 169 getInterpolation method, 213 getItemId() method, 160 getType() method, 37, 84 GiiNii Movit device, 422 Git source-code control system, 18 glClear method, 334 glColor method, 334 glDrawElements method, 332-333 glFrustum method and viewing volume, 336-337

Global Positioning System (GPS), 238 GLSurfaceView, 342-343

gluLookAt method and camera symbolism,

335-336

glVertexPointer method, 330-332 glViewport and screen size, 338 Google Maps, 238-240, 246 GPS Exchange Format (GPX), 261 gravity property, 132-134 grid controls, 126-127 GridView control, 126-127 live folders and, 404-405 group category tags (XML), 175 group IDs to create menu groups, 154

handheld devices, 4

Hello World! example, 25-28

HTTP services exceptions, 269-271

HttpClient for HTTP GET Requests, 264-265

HttpClient for HTTP POST Requests,

266-269 multithreading issues, 272-275 overview, 263 HttpMime, Apache, 267 HttpPost in Android (example), 13

icon menus, 163-164 icon tags, menu (XML), 175 identity matrix, defined, 214 IDialogFinishedCallBack interface, 193 IDialogProtocol interface, 190 IDs, defining custom resource, 48 image resources, 54-55 ImageButton control, 118 IMF (input-method framework), 394 incoming messages, monitoring, 319-321 indexing into point buffer, 332 indices, adding triangle with, 360-362 initialize method, 217 input-method framework (IMF), 394

input methods, writing, 16 insert() method, 38, 85-87 inserting records, 76-77 installing

Android 1.1/1.5, 22 ADT, 22-24 ADT plug-in, 377-379 updates to applications, 229

intents

ACTION_GET_CONTENT, 104-105

ACTION_PICK, 102-104

basics, 91

categories, 99-101

class, defined, 11

classes for defining constants, 99

components to invoke activities, 97-98

data URIs and, 94

defined, 24

extras, 96-97

generic actions, 95

prefabricated applications/intents, 92-94 for recording audio, 386-388 responding to menu items with, 156 rules for resolving to components, 102 for taking pictures, 388-390 interface for media application, 301-305 Internet Assigned Numbers Authority

(IANA), 69 interpolators (animation), 212-213 interprocess communication, 276 ItemizedOverlay, marking up maps with, 246-248

jarsigner tool, 228-229

Java EE (Java Platform, Enterprise Edition), 5

Java ME (Java Platform, Micro Edition) vs. Android Platform, 5-8 OpenGL ES and, 327-328 Java packages, 15-18

Java SE Development Kit (JDK). See JDK 6, downloading Java SE (Java Platform, Standard Edition), 5 Java Virtual Machine (JVM), 2 JAVA_HOME environment variable, 22

JavaFX, 7

JavaServer Faces (JSF), 107 java.util.List/java.util.Map, 292 JDK 6, downloading, 21-22 JSR, 327

K Virtual Machine (KVM), 7 Keyhole Markup Language (KML), 261 keytool utility, 226 Khronos Group, 326-327

launch configuration, Eclipse, 27 layout animation activity and ListView, creating, 206-208 interpolators, 212-213 ListView, animating, 209-212 overview, 204

planning test-harness, 205-206 tweening animation types, 204-205 layout managers, Android

AbsoluteLayout layout manager, 141-142 customizing layout for screen configurations, 145-146 FrameLayout layout manager, 143-144 LinearLayout layout manager, 131-134 overview, 131

RelativeLayout layout manager, 139-140 TableLayout layout manager, 134-139 layout resources, 45-47 LayoutAnimationController, 204 layouts, debugging/optimizing with Hierarchy Viewer, 149-150 lifecycle of Android applications, 38-41 LinearLayout layout manager, 131-134 Linkify Class, 114-115

Linux kernel version 2.6, 8

list controls, 122-126

ListActivity class, 34

listeners and buttons, setting up, 181

prompt dialog, 182

responding to menu items through, 155-156

ListPreference, 365-367

ListView animating, 209-212

control, 122-126

creating, 206-208

live folders and, 404-405

live folders

AllContactsLiveFolderCreatorActivity. java, 412-414

AndroidManifest.xml, 411-412

BetterCursorWrapper.java, 419-420

building, 410-411

deploying through Eclipse, 421

MyContactsProvider.java, 414-419

MyCursor.java, 419

overview, 404-405

SimpleActivity.java, 420-421

user experience of, 405-410

loading menus through XML files, 172

local services basics and examples, 277-282

defined, 25, 276

location-based services android.location package, 249

geocoding. See geocoding

LocationManager service, 257-261

mapping APIs, 238-249

overview, 238

LogCat, 42

long clicks, 165

look-at points, 335-336

M3G graphics standard, 328

managed dialogs

DialogRegistry class, 192

GenericManagedAlertDialog class, 194

GenericPromptDialog class, 195-196

IDialogFinishedCallBack interface, 193

IDialogProtocol interface, 190

ManagedActivityDialog class, 191

ManagedDialogsActivity class, 192

protocol overview, 186

recasting nonmanaged as managed, 186-188

simplifying managed-dialog protocol, 188-190

managedQuery() method, 34, 36, 75-76

manifest editor, 231, 233

manifest files (AndroidManifest.xml), 15

map-api keys (Google), 238-240

mapping APIs, 238-249

maps

MapView control, 130 MapView/MapActivity classes, 240 projection, 90 matching activities, 170 matrices, transformation, 222 Matrix class, 220

MD5 fingerprint (certificates), 239-240 media components, Android, 14-15

MediaPlayer, 305, 311

MediaRecorder class for video capture (Android 1.5), 384-386

MediaScannerConnection class, 390-392

MediaStore class (Android 1.5), 386-390

store, 390-392

media APIs application user interface, 301-305

audio recording, 311-316

media recording/playback, 312-315

MediaPlayer oddities, 311

MediaPlayer to play back local files, 305 overview, 301

setDataSource method, 305-307 video content, playing, 307-311 MenuBuilder.addIntentOptions Method, 171

menus, Android alternative menus, 168-172 basics, 151-152 context menus, 165-168 creating, 153-154

creating test harness. See test harness sample application expanded menus, 163

icon menus, 163-164

loading through XML files, 172

menuCategory tags (XML), 175

responding to changing data, 172

responding to menu items, 154-156

responding to XML-based menu items, 174

Submenus, 164-165 system menus, provisioning for, 165 XML menu resource files, 172-174 XML menu tags, 175-176 messages monitoring incoming, 319-321 sending (SMS), 316-319 metadata, defining for databases, 79-80 Microsoft DirectX API, 326 MIME types structure, Android, 69-71 Mime4j, Apache, 267 MIME-type contracts, fulfilling, 83-84 Miner, Rich, 3 modal dialogs, 184

MultiAutoCompleteTextView control,

116-117 multipart POST calls, 267-269 multithreading issues (HttpClient), 272-275

MyContactsProvider.java (live folders), 414-419

MyCursor.java (live folders), 419

near points, 337

nested PreferenceScreen elements, 373-374 nonmanaged dialogs, recasting as managed, 186-188 nonprimitive types supported by AIDL, 292 Notepad application, 31-38 NotePadProvider class, 36-37 Notes classes, 34 NotificationManager class, 282

onCreate() method, 33, 37-38, 277 onCreateContextMenu() method, 167 onCreateOptionsMenu callback method, 152

onCreateOptionsMenu method, 169 onDestroy() method, 277 online resources, OpenGL ES, 328-329 onListltemClick method (NotesList), 35 OnMenuClickListener interface, 155 onOptionsItemSelected methods, 152,

154-155 onPrepareOptionsMenu, 172 Open Handset Alliance, 3, 18 OpenCORE, 8 OpenGL

animation example, 401-404

OpenGL15TestHarnessActivity.java, 400-401

simplifying, 396-398

triangle OpenGL drawing, 398-401

OpenGL ES (OpenGL for Embedded Systems)

1.0 standard, 12

associating drawing surfaces with,

340-341

background, 327-328

closing resources at program end,

341-342

drawing with, 329-330

EGL context, 338-341

glClear method, 334

glColor method, 334

glDrawElements method, 332-333

glVertexPointer method, 330-332

interfacing with Android, 338-342

online resources, 328-329

using, 328

OpenGL graphics API

camera and coordinates, 334-338

EGL overview, 327-328

glFrustum method and viewing volume, 336-337

gluLookAt method and camera symbolism, 335-336

glViewport and screen size, 338

Java ME and, 327-328

M3G graphics standard, 328

OpenGL ES. See OpenGL ES (OpenGL for Embedded Systems)

overview, 326-327 OpenGL test harness example AbstractRenderer.java, 354-355 camera settings, 358-359 designing, 343-345 EglHelper.java, 352-354 OpenGLDrawingThread.java, 345, 348-352

OpenGLTestHarnessActvity class, 345-346

OpenGLTestHarness.java, 345, 346-348 overview, 342-343 Renderer.java, 354

triangle, adding with indices, 360-362 TriangleRenderer.java, 355-357 optimizing layouts with Hierarchy Viewer,

149-150 options menus, 153

orientation attribute (LinearLayout), 132 orthographic projection (Open GL), 337 overlays, map, 246-249

PackageManager class, 101

padding attribute, 138-139

panning and zooming (maps), 244-245

parcelable interface, 292-299

permissions attributes of, 233-234

custom, 232-238

declaring/using, 230-231

perspective projection (Open GL), 337

PhoneStateListener, 324

populating context menus, 167

populating menus with alternative menu items, 169-170

POST Requests, HTTP, 266-269

prefabricated applications/intents, 92-94

preferences framework

CheckBoxPreference, 367-369

EditTextPreference, 370-371

flight-options example, 363-367

list preferences, 365-367

nested PreferenceScreen elements, 373-374

organizing preferences, 373-376

preference screens, 365

PreferenceCategory elements, 375-376

RingtonePreference, 371-372

primitive shapes (OpenGL ES), 329-330

process boundaries, 229-230

projection maps, 90

projections, 72

prompt dialogs, designing, 179-184, 185 properties, EditText control, 115 Protocol Description Unit (PDU) mode, 320 Provider projects, 19 public methods, android.app.Service,

277-278 public static identifier, 35

0 0

Post a comment