Index [link.springer.com]978-1-4302-2719...Index 465 overview, 104–105 preparations for, 106–108...

27
Index Special Characters and Numerics #ifdef preprocessing directive, 38 #preprocess directive, 310 ${devices} parameter, 107 ${jde.home} property, 104 -1 values, 410 2D graphics, 269–270 3D graphics, 85–86, 238, 269–270 3D images, 74–85 8-bit Unicode Transformation Format (UTF-8) format, 24 A A command, 243 Aarnio, Tomi, 416–417 About option, Options menu, 19 About screen, 19, 129 accelChannel, 139, 181 accelerometer input, 143 AccelerometerSensor.isSupported( ) method, 139 acceptAndOpen( ) method, 346 Access Control code, 120 Access Point Name (APN) configuration, 393 AccessStorage class, 126, 288 ActiveRichTextField class, 134 ActiveRichTextField component, 132, 135–136 Add File to Project, Project menu, 21 addLight( ) method, 428 AddressInfo object, 408 Adobe JRun server, 367 Advanced Options, 22 Alert.startVibrate( ) method, 146 ALX file, 25, 128 AMS (application management system), 9, 13, 24, 50, 59, 101 animate element, 254 animateColor element, 254 animateMotion element, 252–253 animateTransform element, 252 animation loop, 139, 142 animations adding scalable vector graphics, 254–261 controlling from code, 262–268 Space Explorer, 251–252 spinning/flaming, 268 Ant bin directory, 29 Ant property, 29 Ant script, 193 ant task, 33 Ant tool, building for multiple devices with, 25–34 Ant zip file, 107 Antenna Ant tasks, 26 Antenna documentation, 26

Transcript of Index [link.springer.com]978-1-4302-2719...Index 465 overview, 104–105 preparations for, 106–108...

Index

Special Characters and Numerics #ifdef preprocessing directive, 38 #preprocess directive, 310 ${devices} parameter, 107 ${jde.home} property, 104 -1 values, 410 2D graphics, 269–270 3D graphics, 85–86, 238, 269–270 3D images, 74–85 8-bit Unicode Transformation Format

(UTF-8) format, 24

A A command, 243 Aarnio, Tomi, 416–417 About option, Options menu, 19 About screen, 19, 129 accelChannel, 139, 181 accelerometer input, 143 AccelerometerSensor.isSupported( )

method, 139 acceptAndOpen( ) method, 346 Access Control code, 120 Access Point Name (APN)

configuration, 393 AccessStorage class, 126, 288 ActiveRichTextField class, 134

ActiveRichTextField component, 132,

135–136 Add File to Project, Project menu, 21 addLight( ) method, 428 AddressInfo object, 408 Adobe JRun server, 367 Advanced Options, 22 Alert.startVibrate( ) method, 146 ALX file, 25, 128 AMS (application management system),

9, 13, 24, 50, 59, 101 animate element, 254 animateColor element, 254 animateMotion element, 252–253 animateTransform element, 252 animation loop, 139, 142 animations

adding scalable vector graphics, 254–261

controlling from code, 262–268 Space Explorer, 251–252 spinning/flaming, 268

Ant bin directory, 29 Ant property, 29 Ant script, 193 ant task, 33 Ant tool, building for multiple devices

with, 25–34 Ant zip file, 107 Antenna Ant tasks, 26 Antenna documentation, 26

Index 464

Anvil Studio, 180 Apache Tomcat server, 127, 367 APN (Access Point Name)

configuration, 393 apn parameter, 393 appearance. See look and feel application files, 24–25 application font, Sceptre, 435 application management system (AMS),

9, 13, 24, 50, 59, 101 Application tab, 21 Application.invokeAndWait( ) method,

16, 262 Application.invokeLater( ) method, 16,

262, 277 Application.isEventThread( ) method, 15 assisted location mode, 406 Astle, Dave, 416 atan( ) method, 181 atan2( ) method, 181 Audacity, 141 AudioClip interface, 359 audio/x-tone-seq, 180 authenticate parameter, 345 AUTHMODE_ANY variable, 53 authorize parameter, 345 autonomous location mode, 405 AVAILABLE state, 412 Axelson, Jan, 330–331

B back buffer, BoxTrix example, 430–431 backface culling, 426 background grouping, 257 background music, 171 backward( ) method, 339 bar-4 element, 242 base station, for toy car project

and CarControls RIMlet, 354–355 overview, 344–345 processClient method, 346–347 processMsgs method, 347–349 readData method, 349 sendMessage method, 350

Base64 encoding, 287–288 BaseStation application, 327–328, 342,

350–351, 353 BaseStation server, 353–354, 357 BaseStation.java application, 353 BB Maze example, 38, 44, 51, 53–54,

62, 64 bb-ant-tools.jar file, 26, 30 BBCasual font, 137 begin2D( ) method, 450 BES (BlackBerry Enterprise Server), 5,

367 BES/MDS (BlackBerry Enterprise

Server/BlackBerry Mobile Data System), 393

Bézier curves, 242 cubic, 252 and SVG, 236–239

bigGrid.png, 435 billboard, 3D graphic, 445–447 Billboard class, 429, 445 Billboard constructor, 429 Billboard objects, 418 Billboard.draw( ) method, 446–447 billing model, 108–110, 113 bin directory, 30, 34–35, 102 binaries directory, 128 BinaryMessage interface, 189, 228 BIS (BlackBerry Internet Service), 5,

276, 393 Bitmap buffers, 54 Bitmap class, 54, 59–60, 229, 299–300,

311, 394 Bitmap object, 166 BitmapField class, 54, 60, 311 BitmapField frame, 54 Bitmap.getBitmapResource( ) method,

32, 355 Bitmaps class, 165 Bitmap.setARGB( ) method, 166 BlackBerry 7290 simulator, 21, 44 BlackBerry 8900 simulator, 32 BlackBerry Alliance Program, 276, 393 BlackBerry Ant Tools site, 30 BlackBerry App World, selling game on

billing model, 108–110

Index 465

overview, 104–105 preparations for, 106–108 sending dynamic keys, 110–113

BlackBerry application files, 24–25 BlackBerry Curve 8320 menu, 22 BlackBerry Desktop Manager

application, 34 BlackBerry developers site, 9 BlackBerry Enterprise Server (BES), 5,

367 BlackBerry Enterprise

Server/BlackBerry Mobile Data System (BES/MDS), 393

BlackBerry Enterprise Solution, 99 BlackBerry Global Positioning System

(GPS), 374 BlackBerry Internet Service (BIS), 5,

276, 393 BlackBerry Java Application

Development v5.0 beta 5 download, 417

BlackBerry Java Development Environment (JDE), 19–21, 26

BlackBerry Maps Application Programming Interface (API), 374

BlackBerry menu, 21–22 BlackBerry Push API, 367 BlackBerry Push Server, 367 BlackBerry Push Service, 367 BlackBerry security model, 99 BlackBerry service book, 394 BlackBerry simulator, 192, 194 BlackBerry Theme Studio, 5, 29, 235,

251–252 BlackBerry-controlled toy car. See toy

car project BlackBerryCriteria class, 407, 409 BlackBerryLocation class, 409 BlackBerryLocationProvider class, 409 BlackVFMan class, 134–135 blast.png image, 168 BlastSprite class, 139, 168–170 BlastSprite objects, 134, 139 BlastSprite.drop( ) method, 169 BlastSprite.explode( ) method, 146

blocking operation, 275 BlueCarControls class, 327–328, 358–

361 BlueCove, 342, 344, 359 bluecove-2.1.0.jar file, 344 BlueSoleil application, 344 Bluetooth devices, pairing with

CarControls RIMlet, 353 Bluetooth server, for toy car project

BlueCove, 344 JSR 82, 343 overview of technology, 342–343

bmRequestType, 340 BoxTrix example, 417–435

adding lights, 428 animating scene, 420–422 drawing scene, 432–434 initializing graphics engine, 422–425 initializing scene, 425–428 making scenery, 429 shutting down graphics engine, 434–

435 using back buffer, 430–431

BoxTrixScreen class, 418, 448, 450, 457, 461

BoxTrixScreen constructor, 459 BoxTrixScreen thread, 420 Breakout game, 161 BrickBreaker game, 4 Brown, Larry, 368 bubble windows, 238 buffers, image data, 54 Build All and Run option, 20 build file, Ant, 26, 29, 35 build target, 29 build tool, BlackBerry, 23–24 build-all target, 33 build-all.xml file, 33 building game. See compiling and

building game build.xml file, 29, 33, 35, 103–104 bulk transfer, 330 BUNDLE_ID constant, 23 BUNDLE_NAME constant, 23 button presses, 337 ButtonPanel class, 358–359

Index 466

bye$$ message, 347, 354 byte arrays, 53, 113

C C command, 241–242 camera, 453–457

direction constants, 461 modes, 457–462 moving, 457 rotating, 454–456 translating, 456–457

Camera class, 419, 453, 457 Camera instance, 460 Camera object, 453, 461 Camera.move( ) method, 453, 457 Camera.reset( ) method, 453 Canvas class, 59, 229, 312 Canvas component, 254 CarController client, 347 CarControls class, 350–351, 355, 358,

361 CarControls client toy car project, Java

version, 358–362 CarControls( ) method, 352, 354 CarControls RIMlet, 350–358

buttons creation, 355–357 presses and releases, 357–358

communicating with base station, 355

connecting to base station, 354 initializing car controls, 352–353 pairing with Bluetooth devices, 353

carDev, USBCar instance, 349 carHorn word, CarController client, 347 CarTester( ) method, 338, 341 CarTester.java program, 337, 341–342 Catch&Run game, 364 cell site location mode, 405 centerReferencePixel( ) method, 295 certificates, digital, 100–101 Certificates option, 100 Characters class, 149 checkBackBuffer( ) method, 430

checkBlasts( )method, 145 Checkers game, building, 201–234

game logic, 211–228 graphics, 229–234 handling application life cycle, 201–

210 CheckersCanvas class, 208 CheckersGame class, 190, 201, 211,

227 CheckersGame grid, 229 ch.ntb.usb-0.5.9.jar file, 332–333 CLASS constant, 340 Class diagrams, 358 Class.getResourceAsStream( ) method,

75 CLDC (Connected Limited Device

Configuration), 8, 14 clickAngle value, 153, 155–156 clip.addPlayerListener(this) method, 176 ClipsPlayer class, 132, 134, 140, 171,

173, 177, 351–353, 356, 359 ClipsPlayer.load( ) method, 171 ClipsPlayer.playTone( ) method, 178,

180 close( ) method, 142 Close option, 16 closeConnection( ) method, 354 closeDown( ) method, 354, 361 .cod file extension, 25, 128 COD files, 25, 102–104, 106–107, 113,

128 COD/ALX bundle, 128 cOffsets[] array, 179 collision detection, 161 collision processing, 161 collision response, 161 ColumnsGauge display screen, 93–94 Command class, 12 commandAction( ) method, 12 Command.EXIT command, 11 CommandListener interface, 12 commands, 11 Common Lite profile, 415 Common profile, 415 communicating via HTTP, 274–288

Index 467

implementing communications, 274–286

logging in, 286–288 compile-and-build tool, 24 compiling and building game, 19–34

BlackBerry application files, 24–25 building for multiple devices with Ant,

25–34 creating resource files, 22–24 using BlackBerry JDE, 19–21

Composer application, BlackBerry Theme Studio, 251–252

compound COD file, 128 com.versatilemonkey.net package, 322 configAttributes[] array, 425 configuration, 7 Connected Limited Device Configuration

(CLDC), 8, 14 Connection object, 275 ConnectionFactory class, 276 connections, HTTP, 275–276 ConnectionUID parameter, 394 Connector class, 275 Connector.open( ) method, 192, 275–

276, 345 contact list screen, 199, SMS Checkers

game ContactListener class, 196, 201 contactServer( ) method, 355, 361 control transfer, 330 convertToNote( ) method, 179 coordinates

of light saber, in SwingSaber game, 160–161

and transformations, creating games in SVG, 268

Coordinates class, 409 Create a New Image window, 22 Create New File in Project option,

Project menu, 21 Create New Project option, 20 Create Package option, Wireless Toolkit

(WTK) simulator, 192 createBoard( ) method, 445 createCube( ) method, 440, 443 createFloor( ) method, 438

createOverlay( ) method, 449, 451 createScenery( ) method, 429, 435–436 createSVGMatrixComponents( )

method, 270 Creating Icon Image Files sidebar, 21 Criteria class, 407–408 Criteria object, 406, 408–409 Criteria settings, 407 Criteria.setCostAllowed( ) method, 406 Criteria.setHorizontalAccuracy( )

method, 407 Criteria.setPreferredPowerConsumption

( ) method, 407 cryptic error message, 275 CSI files, 102 .cso file extension, 25 cubic Bézier curve, 242, 252 culling, 426 cURL tool, 275 CurrentTime servlet, 368–369 currRotAngle, 153, 156 curves, spline, 254 custom user interface

custom widgets, 93–98 laying out screen with Manager, 88–

93 overview, 87

D d attribute, 241, 252 d element, 241 -D option, 29 data stage, control transfer, 330 data[i + j*w] double array, 300 data[i][j] double array, 299 DataInputStream class, 346 DataOutputStream class, 346 deactivate( ) method, 321 deadlocking, 117 .debug file extension, 25 decrypting, dynamic license keys, 114–

126 default attribute, 29 define elements, 30, 32

Index 468

define statements, 30, 32 defineReferencePixel( ) method, 295 defs section, 241 deliver target, 103, 107 DES algorithm, 113–114, 117 DESKey class, 120 Desktop Java, 416 Desktop Manager' Application Loader

option, 128 Device Manager, Windows, 330 DEVICE_AVAILABLE event, 176 DEVICE_UNAVAILABLE event, 176 devices property, 29 deviceside=true, 392 devices.txt file, 106–107 digital signatures and certificates, 100–

101 direction constants, 458–459 direction vector, 433 dirStatus( ) method, 353, 355, 357 DiscoveryAgent class, 343 DiscoveryAgent.GIAC constant, 345 DiscoveryAgent.LIAC constant, 345 DiscoveryListener interface, 343 Display class, 9, 12 Displayable class, 9, 11–12 Display.callSerially( ) method, MIDlet,

16 displayRemoteMessage( ) method, 286 dist value, 456–457 distributing game, 34–36 doGet( ) method, 368–369, 375, 378 doPost( ) method, 368 double-buffering technique, 54 DOWN constant, 62, 461 downloadReply( ) method, 404 draw( ) method, 159, 164, 400–401,

436, 438, 440, 445, 451 drawBanner( ) method, 370 drawBitmap( ) method, 300 drawBoard( ) method, 447 drawBorder( ) method, 86 drawCube( ) method, 444 drawFloor( ) method, 440 drawFocus( ) method, 93, 320 drawID( ) method, 370

drawImage( ) method, 395 drawing

with graphics, vs. image files, 86–87 surface, 54–60 in SwingSaber game, 159–160, 164

drawLogo( ) method, 370 drawMaze( ) method, 44, 59–60, 85 drawOverlay( ) method, 452 drawScene( ) method, 421, 426, 428,

432, 450 drawSceneGL( ) method, 433–434 drawShadedFilledPath( ) method, 86, 92 Dream Cheeky Car. See toy car project dur attribute, 252 duration argument, 177 Durnil, David, 416 dux variable, 158 duy variable, 158 dvx variable, 158 dvy variable, 158 dx value, 164 dx variable, 154 dy value, 164 dy variable, 154 Dynamic License Flow document, 110 dynamic license keys

decrypting, 114–126 sending, 110–113

dynamic model, BlackBerry App World, 109

E edit paths by nodes tool, 236 EditField class, 286, 288 EE (Java Enterprise Edition), 366–368 Eeckhoudt, Pepijn Van, 428 EG10.eglCreateWindowSurface( )

method, 425 EG10.eglMakeCurrent( ) method, 425 EGL10.eglChooseConfig( ) method, 425 EGL10.eglDestroyContext( ) method,

434 EGL10.eglDestroySurface( ) method,

434

Index 469

EGL10.eglGetConfigs( ) method, 425 EGL10.eglGetError( ) method, 425 EGL10.eglInitialize( ) method, 425 EGL10.eglMakeCurrent( ) method, 434 EGL10.eglSwapBuffers( ) method, 433 EGL10.eglTerminate( ) method, 434 EGL10.eglWaitGL( ) method, 433 EGL10.eglWaitNative( ) method, 433 EJB (Enterprise JavaBeans), 367 Element Defining mainhull, 241 Element That Describes nacelle-4, 240 ellipse tool, 237 elliptical arcs, 243 en01 English label value, 280 enableTexturing( ) method, 439 encoding, Base64, 287–288 encrypt parameter, 345 end2D( ) method, 450–451 endFont, 139 ENDPOINT constant, 340 End/Power key, 149 endTurn( ) method, 228 enterEventDispatcher( ) method, 15 Enterprise JavaBeans (EJB), 367 Environment Variables option, Star

menu, 29 Error: No Connection to Server status

message, 350 event dispatcher thread, 15 EventLogger class, 117, 194, 210 EventLogger.logEvent( ) method, 210 EventLog.startEventLogViewer( )

method, 211 Exception class, 185, 276, 322 exec task, 30, 193 explIms[] array, 165 explode( ) method, 166 explodingCounter counter, 166 ExplodingSprite class, 132, 134, 139,

165, 167–168, 182 ExplodingSprite constructor, 165 ExplodingSprite.explode( ) method, 166 ExplodingSprite.explodeAt( ) method,

166, 168 ExplodingSprite.isExploding( ) method,

167

ExplodingSprite.loadImagesStrip( ) method, 181

ExplodingSprite.update( ) method, 168–169

explosionCounter, 167 explosion.png image, 168 extractContentType( ) method, 172

F Fast Foot Challenge game, 364 FHClient application, 366, 388–390, 408 Field class, 69, 161, 258, 312, 320, 322,

355–356, 358 Field component, 254–255 Field object, 268 FieldAnimator class, 261 FieldAnimator interface, 257, 262, 300–

301, 312 FieldAnimator.frameAdvance( ) method,

262 FieldChangeListener interface, 401 Field.invalidate( ) method, 268 field-of-view angle, 427 file attribute, 29 File Connection API, 51 fill attribute, 241, 252 fill with option, 22 finalUpdates( ) method, 143–144, 181 findDevice( ) method, 338 findName( ) method, 196 findPlayer( ) method, 379 Fixed32 class, 158 flames2 grouping, 240 Flanagan, David, 180 flat oval windows, 238 fledge simulator, 192–194 fledge.exe simulator, 35, 193 floor, 3D graphic

creating, 436–438 drawing, 438–440 overview, 435

Floor class, 429, 436, 440, 444–445 Floor constructor, 429 Floor( ) method, 435–436, 441

Index 470

Floor object, 418 Floor.drawFloor( ) method, 439 FlowFieldManager class, 93 focusRegained, 420 font attributes, 136 Font class, 86 fonts, BlackBerry, 137 for loop, 311 foreground to transparent option, 74 formats, scalable vector graphics (SVG),

239–242 forward( ) method, 339 Fox and Hounds game

client side, 388–389 CurrentTime servlet, 368–369 GPS and BlackBerry, 405–409 GPS gaming, 363–364 killing another player, 401–402 location updater thread, 403–404 manipulating map coordinates

latitude conversion, 387 longitude conversion, 386 Mercator cylindrical projection,

384–385 organizing game

ID creation, 369–371 initializing server, 374–375 making map, 371–374

overview, 366–369 player location information, 399–401 playing game

creating HTTP connection, 393–394

downloading map, 394–395 finishing game, 398–399 positioning map, 395–396 rendering map and players, 397–

398 saying hi to server, 391–392 storing player details, 397

server side "hi" message, 379 initializing server, 376–378 "kill" message, 381–382 "loc" message, 380–381 player information, 382–383

processing client message, 378–379

reinitializing servlet, 378 using GPS in

location provider changes, 411–412

stopping location provider, 412 FoxHoundsServlet servlet, 375–376,

378 FPS constant, 139 frameAdvance( ) method, 268, 271, 301,

311–312 FrameRunner class, 262, 300–301 frustum view, 427 FullScreen class, 148–149, 259 fwd message, 356 fwd word, CarController client, 347

G g elements, 239–240, 270, 272 g groupings, 252, 268 game over message, SwingSaber

game, 147–148 GAME_OVER, 378 GAME_TIME_LENGTH, 378 gameOver global, 143 games, creating in SVG, 261–272

controlling animation from code, 262–268

coordinates and transformations, 268 gameScreen, 136 gameUpdate( ) method, 143 GaugeField class, 93 generateID( ) method, 370 GET command, 275 GET messages, 375 GET method, HyperText Transfer

Protocol (HTTP), 367 GET request, 368, 375 getBitmapResource( ) method, Bitmap

class, 32, 355 getCoord( ) method, 411 getCornerCoordinates( ) method, 227 getCourse( ) method, 408

Index 471

getCredentials( ) method, 288 getElementById( ) method, 268, 270 getGameAction( ) method, 62 getHeight( ) method, 428 getHorizontalAccuracy( ) method,

QualifiedCoordinates class, 409 GetJar business model, 126 GetJar portal, 126 getLocationMethod( ) method, 408 getMoves( ) method, 227 getPosition( ) method, 312 getPreferredHeight( ) method, 356 getPreferredWidth( ) method, 356 getQualifiedCoordinates( ) method, 408 get/set methods, 346 getSpeed( ) method, 408 getSprite( ) method, 293, 295 getTimestamp(

)getQualifiedCoordinates( ) method, 408

getVerticalAccuracy( ) method, QualifiedCoordinates class, 409

getWidth( ) method, 428 GIF encoded images, 21 GIMP (GNU Image Manipulation

Program), 22, 237–238, 293 Ginsburg, Dan, 416 gl object, 425, 435 GL10.GL_MODELVIEW mode, 433–434 GL10.GL_POSITION attribute, 433 GL10.glColorPointer( ) method, 439 GL10.glDrawArrays( ) method, 439–444 GL10.glEnableClientState( ) method,

440 GL10.glLightfv( ) method, 433–434 GL10.glMaterialf( ) method, 426 GL10.glNormal3f( ) method, 440, 442 GL10.glNormalPointer( ) method, 439 GL10.glPopMatrix( ) method, 434, 444,

451 GL10.glPushMatrix( ) method, 434, 444,

451 GL10.glRotatef( ) method, 434 GL10.glTexCoordPointer( ) method, 439 GL10.glTexParameterx( ) method, 439 GL10.glTranslate( ) method, 452

GL10.glVertexPointer( ) method, 439 Glassfish server, 367 glBegin( )/glEnd( ) method, 415 glideRight( ) method, 457 Global Positioning System (GPS)

and BlackBerry, 405–409 gaming, 363–364 using in Fox and Hounds game

location provider changes, 411–412

overview, 409–410 stopping location provider, 412

glossy button, 74 glTexImage2D( ) method, 439 GLU library, 415 GLU.gluLookAt( ) method, 453 gluLookAt( ) method, 453 gluPerspective( ) method, 427–428 GLUT library, 415 GLUtils class, 453 GLUtils class, RIM, 415 GLUtils.glOrtho2D( ) method, 452 GLUtils.glTexImage2D( ) method, 439 GLUtils.gluOrtho2D( ) method, 450–451 GLUtils.gluPerspective( ) method, 427–

428 GNU Image Manipulation Program

(GIMP), 22, 237–238, 293 Google Maps, 373, 384 Google Static Maps, 371 GPS (Global Positioning System)

and BlackBerry, 405–409 gaming, 363–364 using in Fox and Hounds game

location provider changes, 411–412

overview, 409–410 stopping location provider, 412

GPSLocator object, 403, 408–411 GPSLocator.getCoord( ) method, 410 GPSSettings.setPDEInfo( ) method, 407 gradient fills, 239, 243 gradient tool, 74 Graphical User Interface (GUI), 15, 65–

66, 326–327, 350 graphics

Index 472

in Checkers game, 229–234 in Java ME, 269–270

Graphics class, 13, 37, 44, 67, 85–86, 294, 300

graphics engine, BoxTrix example initializing, 422–425 shutting down, 434–435

Graphics implementations, 299 Graphics object, 13, 44, 54, 59–60, 92–

93, 181 Graphics.create( ) method, 181 Graphics.drawBitmap( ) method, 166,

294, 398 Graphics.drawText( ) method, 452 Graphics.fillRect( ) method, 452 Graphics.setColor( ) method, 92 Graphics.setGlobalAlpha( ) method, 92 grass.png, 429, 436 Grid class, 49–50 Grid object, 50–51 GUI (Graphical User Interface), 15, 65–

66, 326–327, 350 guide ellipse, 237

H H command, 242 Hall, Marty, 368 handleRemoteMove( ) method, 228 Handmark portal, 126 hasAlphas argument, 446 hasHit( ) method, 163 HashMap class, 359 Hashtable class, 50, 170–171, 173, 351,

359 hasReachedFloor( ) method, 163 header file, 23 heads-up display (HUD), 447 Heggie, James, 428 height attribute, svg element, 257 Hello BB example, 64 Hello BB icon, 21 Hello BlackBerry example project, 20,

24, 26, 30

Hello BlackBerry resource header file, 23

Hello Plus example, 32 Hello World MIDlet application, 9–13 Hello World RIMlet application, 13–19 HELLOBB_SAYHELLO constant, 23 HelloBB.rapc file, 30 HelloBBRes_fr.rrc file, 24 HelloBBResResource interface, 18, 23 HelloBBRes.rrh file, 23–24 HelloCanvas class, 13 HelloWorldScreen.java class, 31 /help option, fledge simulator, 193 HelpScreen, 418 HID (Human Interface Device), 330–331 HID.DLL library, Windows, 331 hit0.wav file, 146 hit1.wav file, 146 hit2.wav file, 146 hitCounter variable, 146 Höfele, Claus, 417 hostfromdeveloper, 110 HTTP (HyperText Transfer Protocol),

communicating via implementing communications, 274–

286 logging in, 286–288

HTTP POST command, 110 HttpConnection implementation, 274 HttpConnection interface, 275–276, 392 HttpConnectionFactory class, 276, 322,

394 HttpConnectionFactory.TRANSPORTS_

ANY variable, 276 HttpConnectionFactory.TRANSPORTS_

CARRIER_ONLY constant, 394 HttpConnection.HTTP_OK response

code, 392 HTTPPushDemo.java program, 367 httpRequest( ) method, 276 HttpServlet class, 368, 375 HttpServletRequest object, 369 HttpServletResponse object, 369 HUD (heads-up display), 447 Human Interface Device (HID), class of

USB devices, 330–331

Index 473

hutdown( ) method, 434 hybrid property, 371 HyperText Transfer Protocol. See HTTP

I IANA (Internet Assigned Numbers

Authority), 185 id attributes, 268 id tags, 251 IDCreator.java program, 371 identified third-party domain, 101 IDScreen, 388–389, 391 id-type, 381 if test, 147 IM_HEIGHT, 387 IM_WIDTH, 386 Image class, 229, 299 image data buffer, 54 image files, vs. drawing with graphics,

86–87 Image.createImage( ) method, 75 image/JPG web page, 379 images, 3D, 74–85 ImageScreen class, 388–390, 395–397,

401–403, 405 ImageScreen constructor, 391 ImageScreen ImageScreen, 389 ImageScreen.finishGame( ) method,

398 ImageScreen.requestHi( ) method, 404 ImageScreen.updateLocs( ) method,

397–399 images/fwdOff.png, 356 images/fwdOn.png file, 356 img folder, 75 import statement, 37–38 incrementTime( ) method, 268 Index setting, 340 indexed mode, 293 Indexed option, GIMP program, 293 INF file, 332 inf-wizard.exe application, 332 init( ) method, 376, 378

initGraphics( ) method, 422–423, 425–426

initialMessage( ) method, 195 initScene( ) method, 426 Inkscape program, 236–238, 242–243,

251–252 input, accelerometer, 143 InputStream class, 346 InputStream.read( )method, 349 installing game, 34–36 int array, 299 internationalization functionality, RIM, 18 Internet Assigned Numbers Authority

(IANA), 185 interrupt transfer, 330 introductory screen, SwingSaber game,

132–133 IntroScreen class, 134 IntroScreen( ) constructor, 135 IntroScreen object, 133–134 invalidate( ) method, 16, 142, 358, 397 invGud( ) method, 387 invokeAndWait( ) method, 142 invokeLater( ) method, 118, 262 I/O methods, 361 IOException exception, 347 isActive variable, 163 isDeviceAvailable global, 176 isFocus( ) method, 320 isGameOver property, 399 isJPG( ) method, 392 ISO 7816-4 interchange protocol, 126 isochronous transfer, 330 isPaused boolean, 420 isPlaying( ) method, 174 isPressed property, 356, 358 isRunning boolean, 420 isRunning global, 149 isRunning method, 142 isWall( ) accessor, 49 IT policy, 6 Item class, 69 ItemStateListener interface, 69

Index 474

J J2ME Polish, 67 JAD file (Java Application Descriptor

file), 24, 26, 35, 128 .jad file extension, 24 JAD/manifest properties, 30 Jakarta project, 367 JAR file, 24, 26, 35 .jar file extension, 24 Java 3D API, 416 Java Application Descriptor file, 24 Java Application Descriptor file (JAD

file), 24, 26, 35, 128 Java Archive file, 24 Java Community Process (JCP), 5, 7–8 Java Database Connectivity (JDBC),

367 Java Development Environment (JDE),

19–21 Java Enterprise Edition (EE), 366–368 .java file extension, 21 Java libraries, 7 Java Micro Edition (ME), 7–8, 25

graphics in, 269–270 platform for, 16 reasons for using, 4–5

Java security digital signatures and certificates,

100–101 overview, 99–100 signing credentials, 101–104

Java Specification Request (JSR) 0075, 8, 53

Java Specification Request (JSR) 80, 331

Java Specification Request (JSR) 82, 342–343, 345, 353

Java Specification Request (JSR) 120, 8 Java Specification Request (JSR) 179,

405, 409 Java Specification Request (JSR) 184,

269 Java Specification Request (JSR) 226,

239, 269

Java Specification Request (JSR) 238, 18

Java Specification Request (JSR) 239, 413–461

billboard, 445–447 BoxTrix example, 417–435

adding lights, 428 animating scene, 420–422 drawing scene, 432–434 initializing graphics engine, 422–

425 initializing scene, 425–428 making scenery, 429 shutting down graphics engine,

434–435 using back buffer, 430–431

camera direction constants, 461 modes, 457–462 moving, 457 overview, 453 rotating, 454–456 translating, 456–457

floor creating, 436–438 drawing, 438–440 overview, 435

OpenGL ES, 414–417 overlay

coordinates of, 448–449 drawing, 450–452 overview, 447

textured cube creating, 441–443 drawing, 444 overview, 440

Java Specification Request (JSR) 271, 8 Java Standard Edition, 20, 23 Java Transaction API (JTA), 367 Java, USB Library, 331–333 Java Virtual Machine (JVM), 5, 7, 99 java.* application programming

interfaces (APIs), 7 JavaLoader application, 34, 210 JavaLoader tool, 25, 34

Index 475

JavaScript Object Notation (JSON), 280–281

JavaServer Page (JSP), 367 java.util.Locale class, 23 java.util.Random class, 49 java.util.Timer class, 262, 277 java.util.Timer object, 301 java.util.TimerTask class, 262 javax.* APIs, 7 javax.microedition.io classes, 274 javax.microedition.lcdui package, 299 javax.microedition.lcdui.Canvas class,

12, 62 javax.microedition.lcdui.Command

class, 11, 16 javax.microedition.lcdui.game API, 310 javax.microedition.lcdui.game package,

161 javax.microedition.lcdui.game.Sprite

class, 74, 134, 294, 310, 322 javax.microedition.lcdui.game.TiledLaye

r class, 310 javax.microedition.lcdui.Graphics class,

13, 37, 294 javax.microedition.lcdui.Screen class,

67 javax.microedition.lcudui.Gauge objects,

67 javax.microedition.m2g package, 269 javax.microedition.m3g package, 269 javax.microedition.midlet.MIDlet class, 9 JCP (Java Community Process), 5, 7–8 JDBC (Java Database Connectivity),

367 JDE (BlackBerry Java Development

Environment), 19–21 JDE option, Star menu, 20 jdehome attribute, 104 jde.home property, 30 jdp child element, 30 jdp element, 30 JDP file, 21 JDW file, 20 JFrame class, 358 JOGL API, 416 JPanel class, 358

JPEG encoded images, 21 JSON (JavaScript Object Notation),

280–281 JSP (JavaServer Page), 367 JSR. See Java Specification Request JTA (Java Transaction API), 367 JTS files, 140 JVM (Java Virtual Machine), 5, 7, 99

K key property, 371 keyChar( ) method, 15, 62, 149, 261,

268, 320, 457–458, 461 keyCode values, 62 keyDown( ) method, 321 keyPoints attribute, 253 keyPressed( ) method, 62, 227 keySpline attribute, 253 keySplines values, 254 keyTimes attribute, 253 kid field, 376, 389 kid parameter, 401 killPlayer( ) method, 382 KillPopupScreen class, 389, 398, 401 KillPopupScreen.requestKill( ) method,

404

L L command, 241–242 L2CAP (Logical Link Control and

Adaptation Protocol), 343–344 Ladybug Maze game, 107 landmark, 409 LandmarkStore class, 409 LaserSaber.setClickAngle( ), 153 LAT_MAX, 387 lat2y( ) method, 387 latConvert, 387 latitude, conversion of, 387 layout( ) method, 93, 96, 356

Index 476

LayoutManager class, 320 LCDUI (Limited Capability Device User

Interface), 66 LEFT constant, 62, 461 left softkey, MIDP handsets, 11 left word, CarController client, 347 leftPressed( ) method, 227 Length setting, 340 lib directory, 26 LibusbJava API documentation, 337 LibusbJava class, 331–333 LibusbJava library, 332, 337–341 LibusbJava web site, 337 LibusbJava_dll_0.2.4.0.zip file, 332 LibusbJava.usb_close( ) method, 338 LibusbJava.usb_control_msg( ) method,

339–340 libusb-win32 library, 341 libusb-win32 port, 332 libusb-win32-device-bin--0.1.12.1.tar.gz

package, 332 libusb-win32-filter-bin-0.1.12.1.exe

package, 332 license key model, BlackBerry App

World, 109 life cycle class, BB Maze, 64 life cycle, of MIDlets, 7 light saber, in SwingSaber game, 150–

160 coordinates of, 160–161 drawing, 159–160 responding to user input, 153–155 rotating, 155–159

lights, adding BoxTrix example, 428 LightSaber class, 134, 139, 150, 153 LightSaber.move( ) method, 149, 155 LightSaber.setClickAngle( ) method,

149, 181 LightSaber.shake( ) method, 148, 154,

181 LightSaber.update( ) method, 155 Lightweight UI Toolkit (LWUIT), Sun, 67 limitAngle( ) method, 155 Limited Capability Device User Interface

(LCDUI), 66 limitMovement( ) method, 396

List class, 199 ll_CC format, 23 load target, 30, 35 loadClip( ) method, 172, 176 loadFont( ) method, 427 loadImage( ) method, 161 loadImagesStrip( ) method, 165 loadLoop( ) method, 174 loadMap( ) method, 377 loadPlay( ) method, 174 loadPlayersInfo( ) method, 376 LOC_INTERVAL, 411 local installation, 34–35 LocalDevice.getRecord( ) method, 345 localhost hostname, 345 Location API , Java Micro Edition (ME),

405 Location class, 409 Location methods, 408 Location object, 410 LocationListener interface, 408, 411 LocationListener property, 410 LocationProvider class, 409, 412 LocationProvider.getLocation( ) method,

408 LocationProvider.setLocationListener( )

method, 410 locationUpdated( ) method, 408, 410–

411 locRequestTime value, 383 LOCS strings, 381 LocUpdater thread, 388, 390–391, 397,

399, 403, 408, 410–412 Logical Link Control and Adaptation

Protocol (L2CAP), 343–344 login screen, Tweet Space, 287 LoginScreen class, 288 loginUpdated( ) method, 288 lon2x( ) method, 386 lonConvert factor, 386 long UID, 210 longitude (lon), 386, 411 look and feel

3D drawings, 85–86 3D images, 74–85 custom user interface

Index 477

custom widgets, 93–98 laying out screen with Manager,

88–93 overview, 87

overview, 73 loop( ) method, 174 looping, in SwingSaber game, 174 lowercase commands, 242 LWUIT (Lightweight UI Toolkit), Sun, 67

M M command, 241 m<Transform> methods, 271 M3G API, 416 Main class, 201, 208, 211, 258, 320 main life cycle class, 14 main( ) method, 9, 117–118, 337–338,

344 mainhull, 240–241 MainScreen class, 137, 259, 389, 396,

418, 428 MainScreen screen, 208, 210, 228 Main.TWEETSPACE_LISTNAME label,

280 makeConnection( ) method, 354, 360 makeGUI( ) method, 352 makeMenu( ) method, 16 Manage Applications page, 106 Manager class, 88, 93, 96, 176, 288,

320 Manager, laying out screen with, 88–93 Manager.playTone( ) method, 140, 177–

178, 180 manifest file, 24 manufacturer domain, 101 MapCoords class, 375, 386–387 MapCoords object, 377, 381, 383 maps

for Fox and Hounds game downloading, 394–395 making, 371–374 positioning, 395–396 rendering, 397–398

manipulating coordinates for

latitude conversion, 387 longitude conversion, 386 Mercator cylindrical projection,

384–385 overview, 383

Maps API key, 371 maptype property, 371 massively multiplayer online role-playing

games (MMORPGs), 3, 273 MathUtilities.atan2( ) method, 181 matrix.png, 429 matte button, 74 MAX_SCORE, 143 maybeSleep( ) method, 422 maze algorithm, 49–50 Maze Deluxe game, 74, 85–87 Maze game

drawing with Graphics class, 37–50 using memory, 50–53

MazeGame class, 59–60, 62, 67, 75 MazeGame object, 44 MazeGame.move( ) method, 62 MazeScreen class, 59, 62 menu softkey, 11 MenuItem class, 17, 69, 118, 288 Mercator cylindrical projection, and

maps, 384–385 Mercator projection, 372–373 message( ) method, 195 MessageConnection class, 189, 192,

194–195 MessageConnection interface, sending

and receiving SMS messages using, 185–194

MessageConnection object, 184–185 MessageConnection.receive( ) method,

185 MessageField interface, 312, 320 MessageListener object, 185 metal.png, 429 microedition.locale system property, 23 MIDI files, 140, 144 MIDI note numbers, 178–180 MidiPiano, 180 MIDI-to-RTTTL conversion tool, 181 MIDlet class, 9, 11, 24, 62, 201

Index 478

MIDlet suite, 53 MIDlet-Permissions attribute, 101 MIDlet-Permissions-Opt attribute, 101 MIDlet-Push-1 attribute, 194–195 MIDP (Mobile Information Device

Profile), 1, 5, 7–9 libraries, handling platform events

with, 53–71 drawing surface, 54–60 handling user input events, 62–65 using GUI components, 66

Miettinen, Ville, 416 MIME (Multipurpose Internet Mail

Extensions) type, 392 MIN_REQUEST_PERIOD, 381 mipmap generation, 415 MMAPI (Mobile Media API), 140–141,

174, 176, 351 MMORPGs (massively multiplayer

online role-playing games), 3, 273

mMultiply( ) method, 272 Mobile Information Device Profile. See

MIDP Mobile Media API (MMAPI), 140–141,

174, 176, 351 ModedCamera adapter, 419 ModedCamera class, 457, 460–461 ModedCamera.DOWN constant, 458 ModedCamera.FLOAT_GLIDE

constant, 460 ModedCamera.LEFT constant, 458 ModedCamera.move( ) method, 461 ModedCamera.reset( ) method, 460 ModedCamera.RIGHT constant, 458 ModedCamera.ROTATE constant, 460 ModedCamera.setMode( ) method,

459–460 ModedCamera.TRANSLATE constant,

460 ModedCamera.UP constant, 458 ModedCamera.update( ) method, 461 models directory, 29, 34 Modified deliver Target, 104 monitoring players, in SwingSaber

game, 176

motion-to-time relation, 253 MouseEvent object, 359 move( ) method, 155, 227 moveOpponent( ) method, 228 MS-based location mode, 406 MTA_ASSISTED constant, 408 MTA_UNASSISTED constant, 408 MTE_CELLID constant, 408 MTE_SATELLITE constant, 408 multiple devices, building for with Ant

tool, 25–34 Multipurpose Internet Mail Extensions

(MIME) type, 392 multitexturing, 415 Munshi, Aaftab, 416 music, for SwingSaber game

closing and stopping, 175 loading clip, 171–172 looping, 174 monitoring players, 176 note names, 178–180 overview, 170 playing clip, 173–174 playing tones, 176–178

myCornerX coordinate, 311 myCornerY coordinate, 311 myGrid array field, 227 myMessage field, Spaceship class, 312 myNumberOfMoves field, 228 myState field, 211 myToggleCommand, 32 myUpdateScreen field, 118

N nacelle-1 grouping, 252 nacelle-2 grouping, 252 nacelle-3 grouping, 252, 270 nacelle-4 grouping, 252 name=value form, 375 <name> values, 345 <name>=<value> parameters, 345 navigationClick event, 357, 359 navigationClick( ) method, 357–358

Index 479

navigationMovement( ) method, 62, 261, 396, 457, 461

navigationUnclick( ) method, 357–358 NeHe site, 428 net_rim_api.jar file, 30 net.forgparrot.game.RimSprite class,

294 net.frogparrot.game package, 322 net.frogparrot.login package, 288, 322 net.frogparrot.smscheckers package,

202 net.frogparrot.svg package, 258 net.frogparrot.svgmovie package, 322 net.frogparrot.tweetspace package,

290–291, 301, 322 net.frogparrot.ui package, 258, 300,

312–313, 322 net.frogparrot.ui.FieldAnimator class,

258 net.frogparrot.ui.MessageField interface,

288 net.rim graphical APIs, 299 net.rim.* APIs, RIM, 7 net.rim.blackberry.api.mail package, 110 net.rim.device.api.smartcard package,

126 net.rim.device.api.system.Application

class, 9 net.rim.device.api.system.PersistentObj

ect class, 51 net.rim.device.api.system.PersistentStor

e class, 51 net.rim.device.api.ui.component

classes, 96 net.rim.device.api.ui.Field class, 255,

300 net.rim.device.api.ui.Graphics class, 13,

37, 86, 294 net.rim.device.api.ui.MenuItem class, 16 net.rim.device.api.ui.Screen class, 54 networking platform, Twitter, 273 New Game menu, SwingSaber game,

132, 135, 137 New Workspace option, File menu, 20 noInitialMessage( ) method, 195 normals[] array, 443

Notarized Statement of Identification form, 105

notes, in music for SwingSaber game MIDI note numbers, 178–180 names of, 178–180

noticeBd.png, 448 notifyIncomingMessage( ) method, 185 numImages, 165

O OBEX (Object Exchange), 344 Object to Path, Inkscape program, 243 Objective-C track, Apple, 6 offGraphics context, 431 offscreen buffer, 430 onClose( ) method, 16, 261 onFocusNotify( ) method, 420 onObscured( ) method, 259 onVisibilityChange( ) method, 420 Open Workspace option, File menu, 20 OpenGL Architecture Review Board,

416 OpenGL for Embedded Systems

(OpenGL ES), 416–417 operating systems, porting to earlier

(SwingSaber game), 181–182 operator domain, 101 org.json.me package, 322 org.json.me.util package, 322 org.w3g.dom.svg.SVGSVGElement

class, 270 <orientation> character, 290 orthographic projection, 448–449 OTA (Over-the-Air) protocol, 24 OUT constant, 340 OUT_OF_SERVICE state, 411 OutputStream class, 346 Overlay class, 418 Overlay( ) method, 448 overlay, of 3D graphic

coordinates of, 448–449 drawing, 450–452 overview, 447

Overlay.draw( ) method, 450–451

Index 480

Over-the-Air (OTA) protocol, 24

P padlock symbol, JavaDoc, 101 paint( ) method, 13, 16, 93, 96, 146,

229, 300, 358, 399, 447 paintBackground( ) method, 135 paintChild( ) method, 93 paintComponent( ) method, 359 painter's order, 241 paintMaze( ) method, 59 Paired Devices list, 353 PAN (personal area networks),

Bluetooth, 342 parseJson( ) method, 280, 290 path attributes, 241, 252 path clipping, 238 path element, 241, 243, 252 PATH environment variable, 35 PATH variable, 29 pathfromdeveloper option, 110 pauseRendering( ) method, 421 PayPal account, 104 pbuffer, 425 PDE (Position Determining Entity)

server, 406–407 PE Explorer tool, 331 PENDING status value, 335 PERIOD frame rate, 422 persistent object store, RIM, 51 persistent objects, BlackBerry, 53 personal area networks (PAN),

Bluetooth, 342 Personal Information Management

(PIM), finding phone number with, 196–201

PhoneNumberScreen screen, 199, 201, 208

piano keyboard, 177–178 piconet configuration, Bluetooth

personal area networks, 342 PictureButton class, 351, 355, 359 PictureButton( ) method, 356 PictureButton object, 352–353

PIM (Personal Information Management), finding phone number with, 196–201

PIMRunner class, 196, 199, 201 PimScreen screen, 199, 201, 208 pixel buffer, 425 pixmap, 425 platform events, handling with MIDP vs.

RIM drawing surface, 54–60 handling user input events, 62–65 overview, 53 using GUI components, 66

play( ) method, 173–174, 258, 262, 301 Player details, 380 Player events, 176 Player instances, 140–141 Player objects, 170, 359, 375, 377, 379,

382 Player.addPlayerListener(this) method,

172 PlayerListener interface, 172 PlayerLoc array, 397 PlayerLoc class, 389, 399 PlayerLoc objects, 398–399 PlayerLoc[] array, 397 PlayerLoc.draw( ) method, 400 playerLocs[] array, 397 PlayerPiano application, 180 Player.prefetch( ) method, 172 Player.realize( ) method, 172 players, monitoring in SwingSaber

game, 176 Player.start( ) class, 173 players.txt file, 374, 378 playerUpdate( ) method, 176 playTone( ) method, 179–180 Plazmic Media Engine (PME), 235, 252,

255 PME (Plazmic Media Engine), 235, 252,

255 PNG (Portable Network Graphics)

format, 21–22, 293–294 PodTrapper application,

VersatileMonkey, 276 point rendering, 415

Index 481

polling, 143 pool model, BlackBerry App World, 109 PopupScreen class, 401 port number, 192 Portable Network Graphics (PNG)

format, 21–22, 293–294 Position Determining Entity (PDE)

server, 406–407 positionInfo( ) method, 136 positionSplash( ) method, 136 POST command, 110 POST method, HyperText Transfer

Protocol (HTTP), 367 POST request, 110–111, 368 post-download sales model, BlackBerry

App World, 109 postException( ) method, 210 postMessage( ) method, 312 PREFETCHED state, 172 PrefsStorage class, 51, 84 prevRotations[] array, 153, 156 processClient( ) method, 346 processCmd( ) method, 378 processMsgs( ) method, 346–347 processShake( ) method, 154 processShakes( ) method, 143, 148,

181 ProductID property, 329 project node, 29 project.name property, 31 properties file, Java, 24 Properties window, 21 property element, 29 <property

file="models\8900.properties"/> element, 29

property values, Ant, 29 -propertyfile option, 29 protection domains, 101 protocol analyzer, 333 protocol, of toy car, 333–337 providerStateChanged( ) method, 408,

411 ProximityListener interface, 408 Pulli, Kari, 416–417 purchased flag, 114

push registry, sending and receiving SMS messages using, 194–196

PushRegistry class, 194–195 PushRegistry.listConnections( ) method,

195 pyramid, truncated, 427

Q Q command, 242 quadratic Bézier curve, 242 QualifiedCoordinates class, 409 QualifiedCoordinates object, 408 QWERTY keyboard, 5

R Radio Frequency Communication

(RFCOMM), 343–345, 353, 361 rapc compiler, 32 RAPC file, 24, 30 rapc task, 30, 32 RAPC tool, 128 rapc.exe tool, 24–25, 30 rapc.jar file, 30 rd (RemoteDevice) object, 347 read( ) method, 346 readData( ) method, 346–347, 349, 355,

361 REALIZED state, 141, 172 receiving SMS messages. See sending

and receiving SMS messages Record Management System (RMS),

51, 117 RecordStore class, 51, 53 Red Green Blue (RGB) format, 92, 241 redrawTexture( ) method, 451–452 reference pixel, 294 release.xml file, 106–107 remote installation, 35 RemoteDevice (rd) object, 347 RemoteDevice class, 347 RemoteDevice.getFriendlyName( )

method, 347

Index 482

remotely drive toy car. See toy car project

repaint( ) method, 13, 16, 59 repeat option, invokeLater( ) method,

262 repeatCount attribute, 252, 262 reportDeviceName( ) method, 346 Request setting, 340 Request Signatures menu, 102 Request Signatures tool, 102 requestHi( ) method, 392–393, 402 requestKill( ) method, 402 requestLoc( ) method, 404 Research in Motion. See RIM reset( ) method, 454 resource files, creating, 22–24 ResourceBundle class, 18 ResourceBundle.getBundle( ) method,

23 restricted actions, 101 rev word, CarController client, 347 revLeft word, CarController client, 347 revRight word, CarController client, 347 RFCOMM (Radio Frequency

Communication), 343–345, 353, 361

RGB (Red Green Blue) format, 92, 241 RIGHT constant, 62, 461 right softkey, MIDP handsets, 11 right word, CarController client, 347 rightPressed( ) method, 227 RIM (Research in Motion) APIs, 276 RIM (Research in Motion) libraries

handling platform events with, vs. using MIDP

drawing surface, 54–60 handling user input events, 62–65 overview, 53 using GUI components, 66

RIM Java platform, 18 RIMlets, CarControls

button creation, 355–357 button presses and releases, 357–

358 communicating with base station,

355

connecting to base station, 354 initializing car controls, 352–353 overview, 350–351 pairing with Bluetooth devices, 353

RimSprite class, 294, 322 rim.version property, 30 rim-version property, 34 rim-version values, 34 Ring Tone Transfer Language (RTTTL)

format, 180 Ringtone Converter, 181 RMS (Record Management System),

51, 117 roadmap property, 371, 373 Roimela, Kimmo, 416–417 role-playing games on Internet

building Tweet Space game logic, 290–312

communicating via HTTP implementing communications,

274–286 logging in, 286–288

designing screen layout, 312–320 organizing code, 320–323 overview, 273

rotate transformation, 241 rotate="auto" attribute, 253, 262 rotateBitmap( ) method, 299–300 rotateCoords( ) method, 157–158, 161 rotatedTip object, 152 rotateTip( ) method, 158 rotateX( ) method, 454 rotateY( ) method, 454 rotating, light saber in SwingSaber

game, 155–159 rotX value, 455 rotX variable, 454 rotY value, 455 rotY variable, 454 .rrc file extension, 23 .rrh file extension, 23 RTTTL (Ring Tone Transfer Language)

format, 180 Run button, 192 run( ) method, 15, 17, 120, 262, 275,

277, 287, 403, 412, 434

Index 483

run target, 30, 35 run task, 35 Run via OTA option, Wireless Toolkit

(WTK) simulator, 192 Runnable class, 118 Runnable interface, 16, 262, 277, 286,

300

S S command, 242 s value, 437 saberLine[1] array, 152 SaberScreen constructor, 167 SaberScreen listeners, 155 SaberScreen object, 133–134, 138, 140 SaberScreen.gameStart( ) method, 141 SaberScreen.paint( ) method, 168 SaberTrail class, 153 SaberTrail objects, 150, 152–153 SaberTrail.setRotation( ) method, 156 Safety Critical profile, 415 sandbox model, 99 satellite property, 371 sayHiToServer( ) method, 391, 395 sayKillToServer( ) method, 402 scalable vector graphics (SVG), 235–

272 adding animation to game, 254–261 animations, 251–254 Bézier curves and, 236–239 creating game in

controlling animation from code, 262–268

coordinates and transformations, 268

overview, 261 format, 239–242 overview, 236 tiny files, 242–243

scale transformation, 241, 253 scatternet configuration, Bluetooth

personal area networks (PAN), 342

scenes, BoxTrix example

animating, 420–422 drawing, 432–434 initializing, 425–428 making, 429

Sceptre application font, 435 Score string, 147 Screen class, 93, 258, 312, 415 screen layout, designing for role-playing

games on Internet, 312–320 screen stack, 14 screen, SwingSaber game

loading sounds, 140–141 overview, 138–139 painting game, 146–147 processing shakes, 143 starting game, 141–142 updating game, 143–146 user input, 148–149

SDDB (Service Discovery Database), 346

SDP (Service Discovery Protocol), 343–344, 353

searchTable, 360 SecurityException exception, 101 selectNext( ) method, 227 selectPrevious( ) method, 227 SelectSize screen, 87 SelectSizeManager class, 87, 313 selling game

on BlackBerry App World billing model, 108–110 overview, 104–105 preparations for, 106–108 sending dynamic keys, 110–113

decrypting dynamic license keys, 114–126

on own site, 126–129 on web portals, 126

Send key, 149 sendCommand( ) method, 339 sendControl( ) method, 339, 342 sending and receiving SMS messages

overview, 184 using MessageConnection interface,

185–194 using push registry, 194–196

Index 484

sendLocations( ) method, 381 sendMessage( ) method, 286, 320,

346–347, 350, 355 sensor property, 371 Service Book option, 394 Service Discovery Database (SDDB),

346 Service Discovery Protocol (SDP), 343–

344, 353 servicebook classes, 276 ServiceConfiguration class, 110 ServiceFinder class, toy car project,

359–361 ServiceRecord class, 346 ServiceRecord interface, 360 ServletContext interface, 376 ServletContext.getRealPath( ) method,

376 set element, 252–253 SET_REPORT message, 335 SET_REPORT packet, 335–336 SET_REPORT request, 331 setAlienShip( ) method, 280, 312 setClickAngle( ) method, 154–155 setContactList( ) method, 201 setCostAllowed( ) method, 407 setCredentials( ) method, 288 setExtent( ) method, 93, 96 setImage( ) method, 163 setImageSize( ) method, 383 setMenu( ) method, 135 setMessage( ) method, 210 setMove( ) method, 228 setOpponentPhoneNumber( ) method,

201 setRefPixelPosition( ) method, 295 setTimeIncrement( ) method, 257,

SVGAnimator class setup stage, control transfer, 330 setVerticalAccuracy( ) method, 407 setView( ) method, 427–428, 431 setViewportHeight( ) method, 257 setViewportWidth( ) method, 257 shake( ) method, 155 shakes( ) method, 155

shakes, processing in SwingSaber game, 143

sharped version, 178 short codes, SMS, 114 Short Message Service. See SMS showGameOver( ) method, 147, 399 showServices( ) method, 360 Shreiner, Dave, 416 shutdown( ) method, 434–435 signatures, digital, 100–101 SignatureTool application, 102–104, 128 SignatureTool window, 104 SignatureTool.jar file, 102 signing credentials, 101–104 sigtool data files, 104 sigtool files, 102 sigtool task, 104 sigtool.csk file, 102 sigtool.db, 102 sigtool.set file, 102 SIM (subscriber identity module) card,

101 SimpleScreen class, 288 simulator-data folder, 35 single-license model, BlackBerry App

World, 109 skewX transformation, 241 skewY transformation, 241 Small Web Format (SWF) files, 252 SMS (Short Message Service), playing

live opponent with building Checkers game

game logic, 211–228 graphics, 229–234 handling application life cycle,

201–210 finding phone number with PIM,

196–201 overview, 183 sending and receiving messages

overview, 184 using MessageConnection, 185–

194 using push registry, 194–196

SmsDataListener class, 201 SmsDataListener interface, 190, 195

Index 485

smsdemo application, 193 /sms-destination-port argument, 193 SMSManager class, 189–190, 195, 201,

211, 228 SMSMessage class, 185, 189–190 sms-run Ant target, 193 /sms-source-port argument, 193 SnoopyPro protocol analyzer, 334 sodipodi namespace, 243 soft menu, 11 softkeys, 11 sound effects, 171 sound effects players, 171 sounds/ directory, 171 sounds, loading in SwingSaber game,

140–141 SourceUSB protocol analyzer,

SourceQuest, 333–335 Space Explorer game, 237, 239, 251–

252, 261, 268–269, 271 Space Invaders game, 161 space-animation.svg file, 240, 261, 271 space-components.svg file, 261, 271 SpaceLayer class, 301, 310–311 Spaceship class, 290, 293, 295, 312 spaceship grouping, 252–253 spaceship sprite animation file, 238 spaceshipTransform.mTranslate(0f, -

100f) transformation, 269 spawn attribute, 193 spinning/flaming animation, 268 splash screen image, 136 spline curves, 254 Sprite class, 74, 132, 134, 139, 161,

163, 165, 167, 182 <sprite code>, 290, 293 Sprite subclasses, 161 Sprite.getRect( ) method, 163 spriteimage.png file, 75 sprites, in SwingSaber game

bounding box of, 163 coding, 161–163 drawing, 164 exploding, 165–168 updating, 164

Sprite.update( ) method, 167

stand-alone location mode, 405 startApp( ) method, 9, 12, 201 startGame( ) method, 136, 146 startPIM( ) method, 201 startSMS( ) method, 201 static model, BlackBerry App World, 108 status stage, control transfer, 330 stop( ) method, 175, 342, 412 stopRotation( ) method, 156–157 StreamConnection interface, 346 StreamConnection object, 346 StreamConnectionNotifier instance, 345 String argument, 171 String.indexOf( ) method, 137 StringUtilities class, RIM, 290 stroke attribute, 241 style attribute, 243 sublayout( ) method, 93, 96 subpaint( ) method, 92–93, 96, 320 subscriber identity module (SIM) card,

101 SUCCESS Irp status value, 335 Super Mario game, 161 super( ) method, 16 super.touchEvent(message) method,

149 supports.mixing property, 171 SVG. See scalable vector graphics svg element, 257 SVGAnimator class, 254–255, 257, 262 SvgController.frameAdvance( ) method,

262 SVGElement class, 270, 272 SvgFieldAnimator, 321 SVGFieldAnimator class, 257–258 SVGImage class, 268 SVGMatrix class, 270, 272 SVGMatrix.createSVGMatrixComponent

s ( ) method, 272 SVGMatrix.mTranslate( ) method, 271 SvgScreen class, 258, 261 SVGSVGElement class, 270 SWF (Small Web Format) files, 252 SwingSaber class, 133–134, 167–168 SwingSaber game, 131–182

BlastSprite class, 168–170

Index 486

introducing, 134–137 light saber, 150–160

coordinates of, 160–161 drawing, 159–160 responding to user input, 153–

155 rotating, 155–159

music for closing and stopping, 175 loading clip, 171–172 looping, 174 MIDI note numbers, 178–180 monitoring players, 176 note names, 178–180 overview, 170 playing clip, 173–174 playing tones, 176–178

playing tone sequences, 180–181 porting to earlier operating system,

181–182 screen, 138–149

loading sounds, 140–141 painting game, 146–147 processing shakes, 143 starting game, 141–142 updating game, 143–146 user input, 148–149

sprites bounding box of, 163 coding, 161–163 drawing, 164 exploding, 165–168 updating, 164

starting application, 134 SwingSaber.java, 181 symmetric-key algorithm, 113 synchronized blocks, 268 System utility, Control Panel, 330 System.currentTimeMillis( ) method, 142 System.exit( ) method, 15–16 System.getProperty( ) method, 23 System.getProperty("supports.mixing")

method, 140 System.out variable, 194, 210

T t value, 437 target platforms, BlackBerry, 26 TauntBox screen, 208 TCKs (Technology Compatibility Kits), 5 TCP (Transmission Control Protocol),

274, 392–394 Technology Compatibility Kits (TCKs), 5 TEMPORARILY_UNAVAILABLE state,

411–412 terrain property, 371 testlibusb-win.exe application, 332 Tetris game, 161 texCoords[] array, 442–443 TexCube class, 417–418, 429, 440, 445 TexCube constructor, 429 TexCube( ) method, 441 TexCube.draw( ) method, 444 texNames[] array, 437 TextBox class, 199, 208 TextMessage interface, 189, 228 textured cube, 3D graphic

creating, 441–443 drawing, 444 overview, 440

Thread class, 185, 189, 196 TiledLayer class, 310 TimerTask class, 277 timeSpent variable, 147 tone sequences, 140 toString( ) method, 383 touchEvent( ) method, 149, 153, 181 TouchEvent.Click constant, 357 toy car project, 325–362

base station processClient method, 346–347 processMsgs method, 347–349 readData method, 349 sendMessage method, 350

Bluetooth server BlueCove, 344 Bluetooth technology overview,

342–343 JSR 82, 343

car protocol, 333–337

Index 487

Java USB Library, 331–333 Java version of CarControls client

overview, 358 ServiceFinder class, 359–361

RIMlet button creation, 355–357 button presses and releases,

357–358 communicating with base station,

355 connecting to base station, 354 initializing car controls, 352–353 overview, 350 pairing with Bluetooth devices,

353 USB

devices are temperamental, 340–341

HID class of devices, 331 overview, 328–331

USBCar class, 341–342 using LibusbJava library, 337–340

transactionid field, 110 transfer types, 330 transformations, 241, 254, 268 transFwd( ) method, 456 translate transformation, 241 Transmission Control Protocol (TCP),

274, 392–394 true argument,

PushRegistry.listConnections( ) method, 195

truecolor mode, 293 TrueType Unicode format (ttf), 427 truncated pyramid, 427 try catch block, 276 ttf (TrueType Unicode format), 427 Tweet Space game, 290–312 TweetField class, 281, 286–288, 290,

312, 320 TweetReader class, 276–277, 280, 290,

312 Twitter API, 280 Twitter social networking platform, 273 TwoFieldManager class, 313, 320

U UiApplication class, 16 UIApplication class, 114, 133, 353, 356,

358, 389 UIApplication.invokeAndWait( ) method,

142, 146 UiApplication.invokeLater( ) method,

301 uid parameter, 375, 401 uid value, 378 UiEngineInstance class, 182 UiEngineInstance.setAcceptableDirectio

ns( ) method, 134 Ui.getUiEngineInstance( ) method, 182 unassisted location mode, 405 Understanding the Maze Algorithm

sidebar, 49 unidentified third-party domain, 101 uniform resource identifier (URI), 192 uniform resource locator (URL), 275 Universal Serial Bus (USB)

analysis tool, 328 commands for, 327 devices are temperamental, 340–341 errors in Windows, 341 HID class of devices, 331 library for, 331 overview, 328–331 protocol analyzer, 333

universally unique identifier (UUID), 344, 360

UnsupportedOperationException class, 354

UP constant, 62, 461 update( ) method, 143–144, 156–157,

159, 164, 167, 290, 312 updateCamera( ) method, 461 updateFwdDir( ) method, 454–455 updateLocs( ) method, 397, 399, 403 updateTrails( ) method, 156 updating, SwingSaber game, 143–146 upPressed( ) method, 227 URI (uniform resource identifier), 192 URL (uniform resource locator), 275 USB. See Universal Serial Bus

Index 488

usb_control_msg( ) method, 333 USBCar class, of toy car project, 341–

342 USBCar instance, 349 USBCar( ) method, 341 USBDeview analisis tool, 329, 332 USBDeview tool, 328–329 USBHID.dll library, 331 USB.REQ_TYPE_DIR_HOST_TO_DEV

ICE constant, 340 USB.REQ_TYPE_RECIP_ENDPOINT

constant, 340 USB.REQ_TYPE_RECIP_INTERFACE

constant, 340 USB.REQ_TYPE_TYPE_CLASS

constant, 340 use element, 240 user input events, 62–65 user interface (UI), custom

custom widgets, 93–98 laying out screen with Manager, 88–

93 overview, 87

User-Agent, 127–128, 275 useSpeaker( ) method, 172 UTF-8 (8-bit Unicode Transformation

Format) format, 24 Utils class, 427 Utils.disableTexturing( ) method, 446 Utils.enableTexturing( ) method, 438,

446 Utils.showMessage( ) method, 391, 425 UUID (universally unique identifier), 344,

360 UUID field, 345 UUID_STRING constant, 361

V V command, 242 Vaarala, Jani, 416–417 Value setting, 340 values attribute, 253–254 Vavra, David, 364 Vector class, 50

vendor portal, BlackBerry App World, 105

VendorID property, 329 VerticalFieldManager class, 134–135 verts[] array, 443 viewBox attribute, svg element, 257 volatile, 149

W wallBlasts.png image, 167 wallExplSprite object, 139 WAP (Wireless Application Protocol)

2.0, 393–394 Watkins, Marcus, 276, 394 WAV files, 140–141 WAV player, 171 web portals, selling game on, 126 web sites

JSON, 281 selling game on own, 126–129 USB Made Simple, 330

webapps/ directory, 375 while loop, 346 whitespace, 253 widgets

custom, 93–98 focusing on, 93 MIDP, 66 MIDP LCDUI, 70 RIM, 70–71

width attribute, svg element, 257 WidthGauge display screen, 93–94 Wi-Fi, 393 window grouping, 253–254 Windows GUI, Dream Cheeky, 326 Windows Human Interface Device (HID)

API, 331 Windows Start menu, 20 window-scaling transformation, 254 Wireless Application Protocol (WAP)

2.0, 393–394 Wireless Application Protocol (WAP)

Password Authentication Protocol (PAP) 2.2 format, 367

Index 489

Wireless Messaging API, 8 Wireless Toolkit (WTK) simulator, 192 Wireshark tool, 275 write( ) method, 346 WTK (Wireless Toolkit) simulator, 192

X X509 digital certificates, 101 xDir value, 456 xDraw value, 396 xs[] array, 161 xsSaber[] array, 161 XYPoint object, 151–152 xzProj value, 456

Y y-axis, 153 y-coordinates, 44, 92, 254 yDraw value, 396 ys[] array, 161 ysSaber[] array, 161

Z Z command, 241, 252 zDir value, 456 ZeusCMD, 416 Zimmerman, Stephen, 181