James White, David Hemphill9781930110335, 1-930110-33-2
Table of contents :
Java 2 Micro Edition……Page 1
Copyright……Page 3
Preface……Page 14
Contents……Page 6
Acknowledgments……Page 17
About This Book……Page 19
About the Cover Illustration……Page 22
Part 1 Developing with J2ME……Page 23
1.1 So what is J2ME anyway?……Page 25
1.1.1 Where is J2ME being applied?……Page 26
1.2.1 The vast consumer space……Page 27
1.2.2 Consumer electronic and embedded devices……Page 28
1.3.1 Is J2ME mobile?……Page 29
1.3.2 Is J2ME wireless?……Page 30
1.4 The Java 2 edition trilogy……Page 31
1.4.2 J2EE……Page 32
1.4.4 Why we need J2ME……Page 33
1.5.1 Is Java right for small devices?……Page 34
1.5.2 Java’s beneficial features……Page 35
1.6.1 Java’s origins……Page 37
1.7.1 J2ME’s guiding light, the Java Community Process……Page 38
1.8 J2ME products and alternatives……Page 39
1.9 Summary……Page 40
2.1 Goals of the J2ME architecture……Page 41
2.1.2 Support for device-specific functionality……Page 42
2.2 Accommodating opposing needs……Page 43
2.2.1 Configurations and profiles……Page 44
2.2.2 A high-level view of J2ME……Page 45
2.3 Configurations: a closer look……Page 46
2.3.1 Connected Limited Device Configuration (CLDC)……Page 47
2.3.2 The Kilobyte Virtual Machine (KVM)……Page 49
2.3.3 Connected Device Configuration (CDC)……Page 50
2.4 Profiles: a closer look……Page 51
2.4.2 Profiles are modular……Page 52
2.5 Choosing a J2ME profile……Page 53
2.5.4 Personal Profile……Page 54
2.5.7 Multimedia Profile……Page 55
2.5.10 KJava……Page 56
2.6.1 Varied device needs……Page 57
2.8 Designing J2ME applications……Page 58
2.9 Summary……Page 60
Ch3 Developing a J2ME Application……Page 61
3.1.1 The investment quote application customer……Page 62
3.1.2 Requirements analysis……Page 63
3.2.1 Application control……Page 64
3.2.2 User interface design……Page 65
3.2.3 Persistent storage……Page 67
3.2.4 Networking and input/output……Page 68
3.3.1 Obtaining the development environment……Page 70
3.3.3 Runtime environment……Page 71
3.4 Investment quote application tour guide……Page 72
3.5 Summary……Page 73
Part 2 Developing for Cellular Phones & Pagers……Page 75
Ch4 A Simple MIDP Application……Page 77
4.2 Developing MIDP applications……Page 78
4.2.1 Getting started……Page 79
4.2.2 What is a MIDlet?……Page 80
4.2.3 Compiling the application……Page 82
4.2.5 Running the application……Page 83
4.2.6 Troubleshooting……Page 84
4.2.7 JARing MIDlets……Page 85
4.2.8 Developing MIDlet suites……Page 86
4.2.10 Installing MIDlet suites locally……Page 89
4.3 Summary……Page 90
Ch5 MIDP User Interface……Page 91
5.1 MIDP application control……Page 92
5.2 The investment quote application control in MIDP……Page 93
5.3 Two types of MIDP user interface and event handling……Page 97
5.3.2 Low-level API……Page 98
5.4.1 MIDP display control……Page 99
5.4.2 MIDP high-level user interface API……Page 100
5.4.3 MIDP low-level user interface API……Page 109
5.4.4 The investment quote application’s user interface in MIDP……Page 113
5.5 Handling user interactions in MIDP……Page 127
5.5.1 High-level event handling……Page 129
5.5.2 Low-level event handling……Page 132
5.5.3 Handling the events of the Investment Quote Application……Page 136
5.6 MIDlets on other devices……Page 152
5.7 Summary……Page 155
Ch6 MIDP Data Storage……Page 156
6.1 JDBC parallel……Page 157
6.2.1 Record store……Page 158
6.2.2 Records in the record store……Page 159
6.3.1 Record store construction and access……Page 160
6.3.2 Record store exceptions……Page 163
6.3.3 Record store listener……Page 164
6.3.4 Comparing records……Page 166
6.3.5 Filtering records……Page 167
6.3.6 Enumerating through records……Page 168
6.4.1 Defining the stock/mutual fund record……Page 171
6.4.2 Storing quotes……Page 172
6.4.3 Retrieving quotes……Page 178
6.5 Summary……Page 188
Ch7 Connecting to the Internet……Page 189
7.1.1 Using the Connector class to open a channel……Page 190
7.2 Similar but smaller I/O package……Page 191
7.2.2 Readers/Writers……Page 192
7.3 Implementing the Internet investment quote service……Page 193
7.3.1 Getting a quote service connection……Page 194
7.3.2 Extracting the price quote from the HTML……Page 199
7.3.3 The MIDlet’s handling of quote data……Page 202
7.4 Summary……Page 208
Part 3 Developing for PDAs……Page 209
Ch8 J2ME on PDA — KJava Introduction……Page 211
8.1.1 Java PDA development environments……Page 212
8.1.2 What is KJava?……Page 213
8.2.1 Getting Started……Page 214
8.2.2 What is a Spotlet?……Page 215
8.2.3 Compiling HiSmallWorld……Page 216
8.2.4 Preverifying KJava applications……Page 219
8.2.5 Creating the PalmOS application……Page 220
8.2.6 Running the application……Page 224
8.3 Deploying to the actual device……Page 233
8.4 HiSmallWorld revisited using MIDP for Palm OS……Page 235
8.4.1 MIDP application code……Page 236
8.4.2 Converting the JAR file to PRC……Page 237
8.4.3 Deploying the MIDP for Palm OS applications……Page 238
8.5 Summary……Page 239
Ch9 KJava User Interface……Page 240
9.1 KJava application control……Page 241
9.2 The investment quote application control in KJava……Page 242
9.3.1 Drawing to the display with the graphics object……Page 247
9.3.2 Components……Page 253
9.3.4 KJava collection classes……Page 261
9.4.1 Creating and displaying components……Page 262
9.4.2 Drawing with graphics……Page 266
9.5.1 Spotlet event-processing methods……Page 270
9.6.1 Handling key entry events……Page 272
9.6.2 Handling pen taps……Page 274
9.6.3 Handling pen movement……Page 277
9.7 Summary……Page 283
Ch10 KJava Data Storage……Page 284
10.1.2 Palm OS record database……Page 285
10.2.1 Opening and creating databases……Page 287
10.2.2 Accessing the database……Page 289
10.3.1 The stock/mutual fund record……Page 290
10.3.2 Storing investment quotes……Page 291
10.3.3 Retrieving records……Page 295
10.4 Revisiting the connection to the Internet……Page 297
10.5 Accessing Palm OS application databases……Page 307
10.6 Summary……Page 309
Part 4 Developing for Enterprise: Beyond Specifications……Page 311
Ch11 Real-World Design……Page 313
11.1.1 Get them familiar with the devices early……Page 314
11.1.4 State of the organization……Page 315
11.2 A development scenario……Page 316
11.2.1 Analysis……Page 317
11.2.2 Options……Page 318
11.3.1 The user interface……Page 320
11.3.2 The network……Page 326
11.3.3 Data exchange formats……Page 328
11.3.4 Data synchronization……Page 334
11.3.5 Data storage……Page 339
11.3.6 Memory……Page 341
11.3.7 Portability between profiles……Page 342
11.3.8 Security……Page 344
11.3.9 Internationalization……Page 345
11.4.1 Questionnaire: assessing if mobile and wireless is a good fit……Page 347
11.4.2 Mobile application models……Page 348
11.4.3 Architect’s checklist……Page 351
11.5 Summary……Page 353
Ch12 Integrating Server……Page 354
12.1.1 Avoid monolithic applications……Page 355
12.3 Servlet example……Page 356
12.4 XML……Page 369
12.4.1 Using XML……Page 370
12.4.2 Open standards of XML……Page 372
12.4.4 Small-footprint parsers……Page 373
12.5.1 How JavaServer Pages work……Page 375
12.5.2 Creating the JSPHelper……Page 377
12.5.3 Creating the JSP……Page 379
12.5.4 Creating the J2ME Client……Page 380
12.6 Summary……Page 386
Ch13 Network Connection……Page 387
13.1 About the Generic Connection Framework……Page 388
13.1.1 Where the Generic Connection Framework lives……Page 389
13.1.2 Working with the Connector class……Page 390
13.1.4 How the Connector finds the correct class……Page 392
13.3.1 Establishing a connection……Page 394
13.3.2 Using the connection……Page 395
13.3.3 Compiling and running the application……Page 398
13.4 Socket-based connections……Page 399
13.4.1 Writing to sockets……Page 400
13.4.2 Reading from sockets……Page 402
13.4.4 Client-server socket example……Page 403
13.5 Datagram-based connections……Page 416
13.5.1 Datagram example……Page 419
13.6 Summary……Page 428
Ch14 J2ME Runtime Environment……Page 429
14.1.1 Lifecycle of the Java Virtual Machine……Page 430
14.1.2 Java Virtual Machine responsibilities……Page 433
14.3 CLDC-compliant virtual machines (the KVM)……Page 437
14.3.2 Preverification……Page 438
14.3.4 Security……Page 439
14.3.5 Unsupported Java features……Page 441
14.3.7 Garbage collection……Page 443
14.3.9 Application management (JAM)……Page 444
14.3.10 Java Code Compact (JCC)……Page 445
14.3.12 Debug support……Page 446
14.4 CDC-compliant virtual machines (the CVM)……Page 447
14.4.2 Memory references in the CVM……Page 448
14.5 Summary……Page 449
Ch15 Related Technologies……Page 450
15.1.1 esmertec’s Jbed……Page 451
15.2.1 PersonalJava……Page 452
15.2.2 EmbeddedJava……Page 456
15.3.2 IBM’s VisualAge Micro Edition……Page 457
15.4.1 Java Card……Page 460
15.4.2 Java Native Interface……Page 461
15.4.3 Jini……Page 463
15.5 Non-Java alternatives……Page 464
15.5.2 Other languages……Page 465
15.6.1 Data storage……Page 466
15.6.2 A data synchronization standard, SyncML……Page 467
15.6.3 XML……Page 468
15.7.1 GUI, kAWT……Page 470
15.8 Summary……Page 471
AppA J2ME Development Tools……Page 473
AppB J2ME Resources……Page 475
C.1 Oak and the Green Project……Page 478
C.2 Java and the Internet……Page 479
C.3 Evolution of Java……Page 480
C.3.3 Java 2……Page 481
C.4 Origins of J2ME……Page 482
C.4.2 Early access versions of J2ME……Page 483
C.4.3 J2ME’s continuing evolution……Page 484
C.4.4 J2ME today……Page 485
D.1 Downloading the Wireless Toolkit……Page 486
D.2 Installing the J2ME Wireless Toolkit……Page 487
D.3.1 Starting the toolkit……Page 488
D.3.2 Creating a project……Page 489
D.3.3 Editing the project settings……Page 491
D.3.6 Running a project……Page 492
D.3.7 Palm OS Emulator……Page 493
D.4 Summary……Page 494
Index……Page 495
Reviews
There are no reviews yet.