Kicking Butt with MIDP and MSA: Creating Great Mobile Applications

Kicking Butt with MIDP and MSA: Creating Great Mobile Applications

By: Jonathan Knudsen (author)Paperback

2 - 4 weeks availability

Description

The release of MIDP 2.0 and the introduction of the new Mobile Service Architecture (MSA) are generating momentum for the Java ME platform. As more and more Java-enabled mobile devices become available and more service providers become open to third-party development, the demand for customized applications will grow dramatically. Now, there's a practical, realistic guide to building MIDP 2.0/MSA applications that are robust, responsive, maintainable, and fun. Long-time Java ME author Jonathan Knudsen offers real solutions for the complex challenges of coding efficiency, application design, and usability in constrained mobile environments. Experienced Java developers will master MIDP 2.0 and MSA programming through clear, carefully designed examples. Downloadable code is available for both NetBeans Mobility Pack and the Sun Java Wireless Toolkit. Kicking Butt with MIDP and MSA's wide-ranging content covers: * Pushing MIDP's limits, and exploiting MSA's full power * Using MIDlets, Forms, commands, core classes, and invocation * Building effective mobile user interfaces * Designing graphics with the Canvas, the Game API, SVG, and 3D * Providing storage and resources: record stores, FileConnection, and PDA PIM * Internationalizing mobile applications * Networking via WMA, Bluetooth, Web services, and SIP * Parsing XML documents * Implementing audio and advanced multimedia * Securing mobile applications with SATSA and the Payment API * Building advanced location-based applications * Designing applications for multiple devices * Creating end-to-end mobile application architectures

Create a review

About Author

Jonathan Knudsen, a technical writer at Sun, is coauthor of Beginning J2ME. He has written numerous articles about MIDP programming, and has developed several end-to-end Java ME applications. He has also authored or coauthored several books for O'Reilly Media, Inc., including The Unofficial Guide to Lego Mindstorms Robots, Java 2D Graphics, and Java Cryptography. He is a graduate of Princeton University.

Contents

Foreword xvii Preface xix Acknowledgments xxi About the Author xxiiiSECTION I: GETTING STARTED 1Chapter 1: Overview 31.1 Not Plastics, but Wireless 3 1.2 MIDP, the Heart and Soul of Mobile Java Technology 4 1.3 The First Umbrella: JTWI 5 1.4 A Bigger Umbrella: MSA 6 1.5 Understanding MSA APIs 7 1.6 Looking beyond MSA 1.0 9 1.7 What about JavaFX Mobile? 10 1.8 Summary 10Chapter 2: Tools 112.1 Sun Java Wireless Toolkit for CLDC: A Toaster Oven 11 2.2 NetBeans Mobility Pack: A Gourmet Kitchen 13 2.3 Eclipse, Too 13 2.4 Inside a MIDlet Suite 14 2.5 Building a MIDlet Suite 15 2.6 The Command Line: A Campfire 16 2.7 Preprocessors 17 2.8 Obfuscators 17 2.9 Emulators 18 2.10 Device Testing 18 2.11 Summary 19Chapter 3: Quick Start 213.1 Make Something That Runs 21 3.2 Put Something on the Screen 22 3.3 Give the User Something to Do 23 3.4 Get the Source Code Online 25 3.5 Summary 26Chapter 4: Core APIs 274.1 JVM Features You Might Miss 28 4.2 Strings, Primitive Types, and System Methods 28 4.3 Threads 29 4.4 Using Streams for Input and Output 30 4.5 Dates, Collections, and Random Numbers 32 4.6 Summary 33SECTION II: THE LIVES OF MIDLETS 35Chapter 5: The MIDlet Habitat 375.1 The MIDlet Life Cycle 37 5.2 Using the Browser and Making Calls 40 5.3 Application Properties 40 5.4 Protection Domains and Signed MIDlet Suites 41 5.5 Permissions 42 5.6 The Bottom Line on MIDlet Signing 44 5.7 Summary 45Chapter 6: Starting MIDlets Automatically 476.1 Responding to Network Connections 47 6.2 Running a MIDlet at a Specific Time 54 6.3 Responding to Content 56 6.4 Summary 66SECTION III: USER INTERFACE 67Chapter 7: Basic User Interface 697.1 How to Show Screens 70 7.2 TextBox, the Runt of the Litter 71 7.3 Input Modes 72 7.4 Using Alerts for Notifications 73 7.5 A Very Quick Introduction to Images 74 7.6 Putting It Together 74 7.7 Good for the Old Ticker 76 7.8 The Whole Story on Commands 76 7.9 Command Placement 79 7.10 Summary 80Chapter 8: More User Interface 818.1 Lists 81 8.2 List Selections 83 8.3 Handling List Events 83 8.4 Three Lists in One Example 84 8.5 Advanced List Control 86 8.6 Using Forms 86 8.7 Working with Items 88 8.8 Gauges 89 8.9 Controlling Item Layout 90 8.10 Please Drink Form Responsibly 92 8.11 Item Change Events and Item Commands 95 8.12 Summary 98SECTION IV: GRAPHICS 99Chapter 9: Creating Custom Screens 1019.1 Getting Information about the Display 101 9.2 How Painting Works 102 9.3 Making Colors 102 9.4 Drawing Lines and Shapes 105 9.5 Drawing Text 109 9.6 Measuring Text 111 9.7 Creating Images 114 9.8 Drawing Images 116 9.9 Keeping Resources Small 118 9.10 Drawing on Images 119 9.11 Getting Your Fingers on the Bits 121 9.12 Clipping 124 9.13 Event Handling 124 9.14 Controlling Command Placement 127 9.15 Summary 129Chapter 10: Custom Items 13110.1 Custom Item Sizing 131 10.2 Painting 132 10.3 A Pretty Wait Indicator 132 10.4 Handling Events in Custom Items 135 10.5 Internal Traversal 136 10.6 An Interactive Example 137 10.7 Summary 142Chapter 11: Using the Game API 14311.1 Tight Looping with GameCanvas 143 11.2 Building Scenes with Layers 148 11.3 Tiled Layers 149 11.4 Sprites 151 11.5 Detecting Collisions 153 11.6 Assembling a Game Scene 153 11.7 A Blocky Example 154 11.8 Summary 158Chapter 12: Scalable Vector Graphics 15912.1 The Simplest Way to Show SVG Content 160 12.2 Working with Animated Documents 163 12.3 Digging into an SVG Document 166 12.4 Displaying an SVG Document on Your Own Canvas 168 12.5 Creating New SVG Elements 171 12.6 SVG Event Handling 174 12.7 Summary 178Chapter 13: 3D Graphics 17913.1 Creating M3G Files 179 13.2 Displaying 3D Content the Easy Way 180 13.3 Doing It the Hard Way 184 13.4 Summary 192SECTION V: STORAGE AND RESOURCES 193Chapter 14: Record Stores 19514.1 Itsy Bitsy Teenie Weenie Databases 196 14.2 Working with Record Stores 196 14.3 Manipulating Records 198 14.4 Making Queries 199 14.5 Iterating through Records 199 14.6 A Place to Keep Your Stuff 200 14.7 Summary 204Chapter 15: Reading and Writing Files 20515.1 The Quick Story 205 15.2 Working with Files and Directories 206 15.3 Somewhere, a Place for Us 208 15.4 Finding Pictures, Music, and Other Goodies 208 15.5 Starting from the Top 209 15.6 Ask for Permission 209 15.7 An Example 210 15.8 Summary 213Chapter 16: Contacts and Calendars 21516.1 Understanding the PIM API 215 16.2 Working with Lists 217 16.3 Where Do Lists Come From? 220 16.4 Importing and Exporting 221 16.5 What's Supported? 222 16.6 Don't Forget Permissions 222 16.7 Example 223 16.8 Summary 232Chapter 17: Mobile Internationalization 23317.1 About Locales 233 17.2 Using Resources 234 17.3 Finding Resources 235 17.4 Resource Inheritance 237 17.5 Formatting Numbers and Dates 237 17.6 Sorting Strings 239 17.7 Take It Out for a Spin 239 17.8 Summary 244SECTION VI: NETWORKING 245Chapter 18: The Generic Connection Framework 24718.1 Making Connections 247 18.2 Clean Up 249 18.3 Use Threads 250 18.4 Image Loading via HTTP 250 18.5 Advanced HTTP Techniques 252 18.6 Tips for Success 253 18.7 Using HTTPS 254 18.8 Other Connection Types 257 18.9 Incoming Connections 260 18.10 Connection Permissions 261 18.11 Summary 261Chapter 19: Text and Multimedia Messaging 26319.1 Why Messaging? 263 19.2 Sending Messages 264 19.3 Sending Binary Messages 265 19.4 Sending Multipart Messages 266 19.5 Receiving Messages 268 19.6 A Simple Messaging Application 269 19.7 Summary 273Chapter 20: Bluetooth and OBEX 27520.1 Control Your Own Bluetoothiness 276 20.2 Finding Other Bluetooth Devices and Services 276 20.3 Cheap Shots 278 20.4 Making a Client Connection 278 20.5 Setting Up a Server 279 20.6 Authorization and Encryption 280 20.7 What about OBEX? 280 20.8 Don't Forget the Push Registry 282 20.9 Permissions for Bluetooth and OBEX 282 20.10 The BlueChew Application 283 20.11 Summary 293Chapter 21: XML and Web Services 29521.1 Parsing XML 296 21.2 Creating a Handler 296 21.3 Parsing RSS 298 21.4 Parsing XML without JSR 172 301 21.5 Using WS-* Web Services 303 21.6 Harness the World 307 21.7 A Mobile Client for Flickr 308 21.8 Summary 317Chapter 22: Session Initiation Protocol 31922.1 Understanding SIP 320 22.2 Development Tools 321 22.3 Setting Up a Notifier 321 22.4 Sending Requests 321 22.5 Receiving SIP Requests and Sending Responses 322 22.6 GoSIP and SIPDemo 323 22.7 Summary 324SECTION VII: MULTIMEDIA 325Chapter 23: Playing and Recording Sound and Video 32723.1 Boring Background Information 327 23.2 Tones 329 23.3 Using Players 329 23.4 Supported Content Types 331 23.5 Threading and Listening 332 23.6 Taking Control 332 23.7 Playing Sampled Audio Content 333 23.8 Playing Video Content 333 23.9 The Tone Sequence Player 335 23.10 The Interactive MIDI Player 336 23.11 Recording Audio 337 23.12 Capturing Video 338 23.13 You Can't Make Everyone Happy 338 23.14 About MMMIDlet 339 23.15 Summary 340Chapter 24: Advanced Multimedia 34124.1 Image Processing 342 24.2 Controlling Image Format 344 24.3 Music 345 24.4 3D Audio 345 24.5 Audio Special Effects 347 24.6 More Camera Control 347 24.7 Plain Old Radio 348 24.8 Summary 349SECTION VIII: SECURITY AND TRANSACTIONS 351Chapter 25: Smart Cards and Cryptography 35325.1 Smart Cards? Really? 354 25.2 Testing SATSA Applications with the Emulator 354 25.3 Basic Smart Card Communication 355 25.4 Smart Card Communication with Java Card RMI 355 25.5 Generating Signatures 356 25.6 Managing Certificates 357 25.7 Cryptography 357 25.8 Summary 359Chapter 26: Mobile Payments 36126.1 Show Me the Money! 362 26.2 Matching Applications to Payment Providers 364 26.3 Editing Payment Provisioning Information 365 26.4 Security and Payments 366 26.5 Summary 366Chapter 27: Know Where You Are 36927.1 The Short Story 370 27.2 An Even Shorter Story 371 27.3 Receiving Periodic Location Updates 371 27.4 Getting Close 371 27.5 Landmark Databases 372 27.6 Orientation 373 27.7 Simulating Device Location 373 27.8 Summary 374Chapter 28: Application Architecture 37528.1 Use the Strengths of Java ME 375 28.2 Use the Strengths of the Internet 376 28.3 Don't Cram the Desktop into a DJava ME Application 376 28.4 Developing for Multiple Devices 377 28.5 Stretchy Screens 377 28.6 Make It Just Work 378 28.7 Summary 379Index 381

Product Details

  • publication date: 29/12/2007
  • ISBN13: 9780321463425
  • Format: Paperback
  • Number Of Pages: 432
  • ID: 9780321463425
  • weight: 662
  • ISBN10: 0321463420

Delivery Information

  • Saver Delivery: Yes
  • 1st Class Delivery: Yes
  • Courier Delivery: Yes
  • Store Delivery: Yes

Prices are for internet purchases only. Prices and availability in WHSmith Stores may vary significantly

Close