A

accelerometer state, reading, 141-144

AccelerometerHandler, 193-194, 208

accessing peripherals, 7

acquire( ) method, 158

Acra library, 626, 635

<action> element, 108

action games, 56-59

action mask event type, 133

active matrices, 289

activities life cycle of, 120-127 in practice, 123-127 in theory, 120-123 starting programmatically, 118-119 test, 119-120 Activity class default, 232-237 Assets class, 233 LoadingScreen class, 236-237 Settings class, 234-235 main, 448-449, 591-592 <activity> elements, 107-109, 113-114,

124, 160, 351, 490, 525 Activity notificaton method, 286 activity stack, 120

Activity with a Button, 37 Activity.isFinishing( ) method, 123, 125 Activity.onCreate( ) method, 36, 121,

150, 159 Activity.onDestroy( ) method, 121 Activity.onPause( ) method, 121, 159 Activity.onRestart( ) method, 121 Activity.onResume( ) method, 121, 159 Activity.onStart( ) method, 120 Activity.onStop( ) method, 120 ADB (Android Debug Bridge) tool, 48-50

ADB daemon component, 48 ADC (Android Developer Challenge), 6 add( ) method, 359, 528 addScore( ) method, 235 ADP (Android Dev Phone), 6 ADT (Android Development Tools)

plug-in, for Eclipse, installing, 28-30, 44 advance( ) method, 254 Allocation Tracker view, 48 alpha blending, 321-325 alpha compositing, of graphics, 87-91 Ambient color, 532-533 ambient light, 532, 535-536 ambientColor array, 535 AmbientLight, 545 AndEngine engine, 639 Android history of, 2-3 Open Source Project, 3-4 Android Application option Debug As menu, 43 Run As menu, 39 Android Debug Bridge (ADB) tool, 48-50

Android Dev Phone (ADP), 6 Android Developer Challenge (ADC), 6 Android Development Tools (ADT) plugin, for Eclipse, installing, 28-30, 44

Android Market, 4-6, 631-634 Listing Details section, 633 marketing, 634

Publishing Options panel, 633-634

publishing page, 634 uploading assets, 632-633 android namespace, 105 Android Package (APK) files, signing, 627-631

Android SDK (Software Development Kit). See also development environment ADB tool, 48-50 connecting device, 38 creating Android virtual device, 38-39

debugging applications, 42-48 hello world project, 32-37 creating project, 32-33 exploring project, 33-35 writing application code, 35-37 running applications, 39-42 setting up, 26-27 AndroidAudio implementation, 187 AndroidAudio instance, 187, 224-225 AndroidAudio.newMusic( ) method, 189 AndroidAudio.newSound( ) method, 187 AndroidBasicsStarter activity, 116-118 AndroidBasicsStarter class, 117-119, 124

AndroidBitmap, 218 android:debuggable attribute, manifest file, 627 AndroidFastRenderView class, 220-221, 223-225, 227 AndroidFilelO class, 187, 224-225, 284 AndroidGame class, 97, 221, 223-224,

227, 281,283-284 AndroidGame parameter, 221 AndroidGame.setScreen( ) method, 227 AndroidGraphics, 216, 220, 224-225, 284

AndroidGraphics.drawPixmap( )

methods, 217 android.hardware.touchscreen.multitouch feature, 111 android.hardware.touchscreen.multitouch.

distinct feature, 111 ANDROID_HOME variable, 26

Androidlnput class, 201, 207, 224-225, 284

android:installLocation attribute, 627 android.intent.action.MAIN intent, 108 android.intent.category.LAUNCHER

intent, 108 AndroidManifest.xml file, 34, 43, 105, 112-113

android:minSdkVersion attribute, 627 AndroidMusic class, 189-190 AndroidMusic instance, 188 android.permission.INTERNET

permission, 109 android.permission.RECORD_AUDIO

permission, 109 android.permission.WAKE_LOCK

permission, 110, 113 android.permission.WRITE_EXTERNAL_

STORAGE permission, 109 android.permission.WRITE_EXTERNAL

STORAGE permission, 113 AndroidPixmap, 219-220 AndroidSound class, 188-189 android:targetSdkVersion attribute, 627 android:versionCode attribute, 627 android:versionName attribute, 627 android.view.KeyEvent.KEYCODE_XXX

constants, 197 angle member, 544 angle( ) method, 359, 530 animation, 422-428

Animation class, 423-424 example, 424-428 Animation class, 423-424, 445, 461, 463

Animation instance, 424-428, 439, 446 Animation.ANIMATION_LOOPING, 424 Animation.NON_LOOPING, 424 AnimationScreen class, 424-425 AnimationTest class, 424-425 APIs (application programming interfaces), 116-182 activity life cycle, 120-127 in practice, 123-127 in theory, 120-123 audio programming, 150

file handling, 144-150

accessing external storage,

146-150 reading assets, 144-146 graphics programming, 158-182 bitmaps, 169-174 continuous rendering, 160-182 coordinate systems, 163-164 drawing simple shapes, 164-168 full screen, 159-160 rendering text, 174-177 screen resolution, 163-164 wake locks, 158-159 input device handling, 127-144 key events, 137-140 multitouch events, 127-133 reading accelerometer state,

141-144 single-touch events, 127-131 playing sound effects, 150-154 streaming music, 154-158 test project, 116-120

AndroidBasicsStarter activity, 116-118 creating test activities, 119-120 starting activities programmatically, 118-119 APK (Android Package) files, signing, 627-631

<application> element, 43, 105-109,

113-114, 124, 627 application framework, 10-11 application programming interfaces.

See APIs application window, 71 arcade games, 56-59 architecture, features and, 7-11 application framework, 10-11 Linux kernel, 8

runtime and Dalvik virtual machine, 8-9

system libraries, 9-10 Ardor3D engine, 639 ARM-based CPU, 13 ArrayList class, 194-195 ArrayLists, 391

art style, and game design, 63-64 ASCII format, 438 aspect ratios coping with different, 212-214 overview, 211-212 AssetFileDescriptor, 154, 188, 190 AssetManager class, 144, 153,

187-188, 216-217 AssetManager.open( ) method, 144 AssetManager.openFd( ) method, 151, 188

assets creating, 435-443, 582-586 game assets, 584-586 game elements, 439-441 handling text with bitmap fonts,

437-439 for Mr. Nom game, 229-231 music and sound, 442-443 sound and music, 586 texture atlas, 441-442 UI assets, 582-584 UI elements, 435-437 fetching from disk, 236-237 reading, 144-146 uploading to Android Market, 632-633

Assets class, 233, 444-447, 587-590 assets/dir/dir2/ directory, 145 assets/ directory, 34, 106, 145, 151, 156, 173-174, 188, 229, 407 Assets.java file, 587 Assets.load( ) method, 449, 591 Assets.mainmenu image, 246 Assets.playSound( ) method, 453, 467 Assets.reload( ) method, 449 atan2( ) method, 359 atlas.png, 407

audience, for mobile gaming, 20-21 audio, 76-80

compression of, 77-78 implementing in game, 78-80 physics of sound, 76 playback of, 76-77 quality of, 77-78 recording of, 76-77

Audio class, 187-192

Audio interface, 79

Audio module, 70, 96

audio programming, setting volume controls, 150 Audio.newMusic( ) method, 79 Audio.newSound( ) method, 79 Axis Aligned Bounding Box, 573 Axis-aligned bounding box bounding type, 374

0 0

Post a comment