James White, David Hemphill1930110332, 9781930110335
Table of contents :
Java 2 Micro Edition……Page 3
preface……Page 15
contents……Page 7
acknowledgments……Page 18
about this book……Page 20
about the cover illustration……Page 23
Part 1 Developing with J2ME……Page 25
1.1 So what is J2ME anyway?……Page 27
1.1.1 Where is J2ME being applied?……Page 28
1.2.1 The vast consumer space……Page 29
1.2.2 Consumer electronic and embedded devices……Page 30
1.3.1 Is J2ME mobile?……Page 31
1.3.2 Is J2ME wireless?……Page 32
1.4 The Java 2 edition trilogy……Page 33
1.4.2 J2EE……Page 34
1.4.4 Why we need J2ME……Page 35
1.5.1 Is Java right for small devices?……Page 36
1.5.2 Java’s beneficial features……Page 37
1.6.1 Java’s origins……Page 39
1.7.1 J2ME’s guiding light, the Java Community Process……Page 40
1.8 J2ME products and alternatives……Page 41
1.9 Summary……Page 42
2.1 Goals of the J2ME architecture……Page 43
2.1.2 Support for device-specific functionality……Page 44
2.2 Accommodating opposing needs……Page 45
2.2.1 Configurations and profiles……Page 46
2.2.2 A high-level view of J2ME……Page 47
2.3 Configurations: a closer look……Page 48
2.3.1 Connected Limited Device Configuration (CLDC)……Page 49
2.3.2 The Kilobyte Virtual Machine (KVM)……Page 51
2.3.3 Connected Device Configuration (CDC)……Page 52
2.4 Profiles: a closer look……Page 53
2.4.2 Profiles are modular……Page 54
2.5 Choosing a J2ME profile……Page 55
2.5.4 Personal Profile……Page 56
2.5.7 Multimedia Profile……Page 57
2.5.10 KJava……Page 58
2.6.1 Varied device needs……Page 59
2.8 Designing J2ME applications……Page 60
2.9 Summary……Page 62
3 Developing a J2ME application……Page 63
3.1.1 The investment quote application customer……Page 64
3.1.2 Requirements analysis……Page 65
3.2.1 Application control……Page 66
3.2.2 User interface design……Page 67
3.2.3 Persistent storage……Page 69
3.2.4 Networking and input/output……Page 70
3.3.1 Obtaining the development environment……Page 72
3.3.3 Runtime environment……Page 73
3.4 Investment quote application tour guide……Page 74
3.5 Summary……Page 75
Part 2 Developing for cellular phones and pagers……Page 77
4 A simple MIDP application……Page 79
4.2 Developing MIDP applications……Page 80
4.2.1 Getting started……Page 81
4.2.2 What is a MIDlet?……Page 82
4.2.3 Compiling the application……Page 84
4.2.5 Running the application……Page 85
4.2.6 Troubleshooting……Page 86
4.2.7 JARing MIDlets……Page 87
4.2.8 Developing MIDlet suites……Page 88
4.2.10 Installing MIDlet suites locally……Page 91
4.3 Summary……Page 92
5 MIDP user interface……Page 93
5.1 MIDP application control……Page 94
5.2 The investment quote application control in MIDP……Page 95
5.3 Two types of MIDP user interface and event handling……Page 99
5.3.2 Low-level API……Page 100
5.4.1 MIDP display control……Page 101
5.4.2 MIDP high-level user interface API……Page 102
5.4.3 MIDP low-level user interface API……Page 111
5.4.4 The investment quote application’s user interface in MIDP……Page 115
5.5 Handling user interactions in MIDP……Page 129
5.5.1 High-level event handling……Page 131
5.5.2 Low-level event handling……Page 134
5.5.3 Handling the events of the Investment Quote Application……Page 138
5.6 MIDlets on other devices……Page 154
5.7 Summary……Page 157
6 MIDP data storage……Page 158
6.1 JDBC parallel……Page 159
6.2.1 Record store……Page 160
6.2.2 Records in the record store……Page 161
6.3.1 Record store construction and access……Page 162
6.3.2 Record store exceptions……Page 165
6.3.3 Record store listener……Page 166
6.3.4 Comparing records……Page 168
6.3.5 Filtering records……Page 169
6.3.6 Enumerating through records……Page 170
6.4.1 Defining the stock/mutual fund record……Page 173
6.4.2 Storing quotes……Page 174
6.4.3 Retrieving quotes……Page 180
6.5 Summary……Page 190
7 Connecting to the Internet……Page 191
7.1.1 Using the Connector class to open a channel……Page 192
7.2 Similar but smaller I/O package……Page 193
7.2.2 Readers/Writers……Page 194
7.3 Implementing the Internet investment quote service……Page 195
7.3.1 Getting a quote service connection……Page 196
7.3.2 Extracting the price quote from the HTML……Page 201
7.3.3 The MIDlet’s handling of quote data……Page 204
7.4 Summary……Page 210
Part 3 Developing for PDAs……Page 211
8 J2ME on a PDA, a KJava introduction……Page 213
8.1.1 Java PDA development environments……Page 214
8.1.2 What is KJava?……Page 215
8.2.1 Getting Started……Page 216
8.2.2 What is a Spotlet?……Page 217
8.2.3 Compiling HiSmallWorld……Page 218
8.2.4 Preverifying KJava applications……Page 221
8.2.5 Creating the PalmOS application……Page 222
8.2.6 Running the application……Page 226
8.3 Deploying to the actual device……Page 235
8.4 HiSmallWorld revisited using MIDP for Palm OS……Page 237
8.4.1 MIDP application code……Page 238
8.4.2 Converting the JAR file to PRC……Page 239
8.4.3 Deploying the MIDP for Palm OS applications……Page 240
8.5 Summary……Page 241
9 KJava user interface……Page 242
9.1 KJava application control……Page 243
9.2 The investment quote application control in KJava……Page 244
9.3.1 Drawing to the display with the graphics object……Page 249
9.3.2 Components……Page 255
9.3.4 KJava collection classes……Page 263
9.4.1 Creating and displaying components……Page 264
9.4.2 Drawing with graphics……Page 268
9.5.1 Spotlet event-processing methods……Page 272
9.6.1 Handling key entry events……Page 274
9.6.2 Handling pen taps……Page 276
9.6.3 Handling pen movement……Page 279
9.7 Summary……Page 285
10 KJava data storage……Page 286
10.1.2 Palm OS record database……Page 287
10.2.1 Opening and creating databases……Page 289
10.2.2 Accessing the database……Page 291
10.3.1 The stock/mutual fund record……Page 292
10.3.2 Storing investment quotes……Page 293
10.3.3 Retrieving records……Page 297
10.4 Revisiting the connection to the Internet……Page 299
10.5 Accessing Palm OS application databases……Page 309
10.6 Summary……Page 311
Part 4 Developing for the enterprise: beyond the specifications……Page 313
11 Real-world design……Page 315
11.1.1 Get them familiar with the devices early……Page 316
11.1.4 State of the organization……Page 317
11.2 A development scenario……Page 318
11.2.1 Analysis……Page 319
11.2.2 Options……Page 320
11.3.1 The user interface……Page 322
11.3.2 The network……Page 328
11.3.3 Data exchange formats……Page 330
11.3.4 Data synchronization……Page 336
11.3.5 Data storage……Page 341
11.3.6 Memory……Page 343
11.3.7 Portability between profiles……Page 344
11.3.8 Security……Page 346
11.3.9 Internationalization……Page 347
11.4.1 Questionnaire: assessing if mobile and wireless is a good fit……Page 349
11.4.2 Mobile application models……Page 350
11.4.3 Architect’s checklist……Page 353
11.5 Summary……Page 355
12 Integrating the server……Page 356
12.1.1 Avoid monolithic applications……Page 357
12.3 Servlet example……Page 358
12.4 XML……Page 371
12.4.1 Using XML……Page 372
12.4.2 Open standards of XML……Page 374
12.4.4 Small-footprint parsers……Page 375
12.5.1 How JavaServer Pages work……Page 377
12.5.2 Creating the JSPHelper……Page 379
12.5.3 Creating the JSP……Page 381
12.5.4 Creating the J2ME Client……Page 382
12.6 Summary……Page 388
13 The network connection……Page 389
13.1 About the Generic Connection Framework……Page 390
13.1.1 Where the Generic Connection Framework lives……Page 391
13.1.2 Working with the Connector class……Page 392
13.1.4 How the Connector finds the correct class……Page 394
13.3.1 Establishing a connection……Page 396
13.3.2 Using the connection……Page 397
13.3.3 Compiling and running the application……Page 400
13.4 Socket-based connections……Page 401
13.4.1 Writing to sockets……Page 402
13.4.2 Reading from sockets……Page 404
13.4.4 Client-server socket example……Page 405
13.5 Datagram-based connections……Page 418
13.5.1 Datagram example……Page 421
13.6 Summary……Page 430
14 J2ME runtime environment……Page 431
14.1.1 Lifecycle of the Java Virtual Machine……Page 432
14.1.2 Java Virtual Machine responsibilities……Page 435
14.3 CLDC-compliant virtual machines (the KVM)……Page 439
14.3.2 Preverification……Page 440
14.3.4 Security……Page 441
14.3.5 Unsupported Java features……Page 443
14.3.7 Garbage collection……Page 445
14.3.9 Application management (JAM)……Page 446
14.3.10 Java Code Compact (JCC)……Page 447
14.3.12 Debug support……Page 448
14.4 CDC-compliant virtual machines (the CVM)……Page 449
14.4.2 Memory references in the CVM……Page 450
14.5 Summary……Page 451
15 Related technologies……Page 452
15.1.1 esmertec’s Jbed……Page 453
15.2.1 PersonalJava……Page 454
15.2.2 EmbeddedJava……Page 458
15.3.2 IBM’s VisualAge Micro Edition……Page 459
15.4.1 Java Card……Page 462
15.4.2 Java Native Interface……Page 463
15.4.3 Jini……Page 465
15.5 Non-Java alternatives……Page 466
15.5.2 Other languages……Page 467
15.6.1 Data storage……Page 468
15.6.2 A data synchronization standard, SyncML……Page 469
15.6.3 XML……Page 470
15.7.1 GUI, kAWT……Page 472
15.8 Summary……Page 473
A J2ME development tools……Page 475
B J2ME resources……Page 477
C.1 Oak and the Green Project……Page 480
C.2 Java and the Internet……Page 481
C.3 Evolution of Java……Page 482
C.3.3 Java 2……Page 483
C.4 Origins of J2ME……Page 484
C.4.2 Early access versions of J2ME……Page 485
C.4.3 J2ME’s continuing evolution……Page 486
C.4.4 J2ME today……Page 487
D.1 Downloading the Wireless Toolkit……Page 488
D.2 Installing the J2ME Wireless Toolkit……Page 489
D.3.1 Starting the toolkit……Page 490
D.3.2 Creating a project……Page 491
D.3.3 Editing the project settings……Page 493
D.3.6 Running a project……Page 494
D.3.7 Palm OS Emulator……Page 495
D.4 Summary……Page 496
index……Page 497
Reviews
There are no reviews yet.