Apress.Beginning.Java(tm).ME.Platform.Oct.2008.pdf

(3707 KB) Pobierz
373153904 UNPDF
Beginning Java ME
Platform
Ray Rischpater
373153904.069.png 373153904.080.png 373153904.091.png 373153904.102.png 373153904.001.png 373153904.012.png 373153904.021.png 373153904.022.png 373153904.023.png 373153904.024.png 373153904.025.png 373153904.026.png 373153904.027.png 373153904.028.png 373153904.029.png 373153904.030.png 373153904.031.png 373153904.032.png 373153904.033.png 373153904.034.png 373153904.035.png 373153904.036.png 373153904.037.png 373153904.038.png
Beginning Java ME Platform
Copyright © 2008 by Ray Rischpater
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-1061-0
ISBN-10 (pbk): 1-4302-1061-3
ISBN-13 (electronic): 978-1-4302-1062-7
ISBN-10 (electronic): 1-4302-1062-1
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Java™ and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc., in
the US and other countries. Apress, Inc., is not affiliated with Sun Microsystems, Inc., and this book was
written without endorsement from Sun Microsystems, Inc.
Lead Editor: Steve Anglin
Technical Reviewer: Christopher King
Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan
Gennick, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke,
Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Richard Dal Porto
Copy Editor: Nicole Abramowitz
Associate Production Director: Kari Brooks-Copony
Production Editor: Katie Stence
Compositor: Patrick Cunningham
Proofreader: Liz Welch
Indexer: Brenda Miller
Artist: April Milne
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com ,or
visit http://www.springeronline.com .
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com , or visit
http://www.apress.com .
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our Special
Bulk Sales—eBook Licensing web page at http://www.apress.com/info/bulksales .
The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have
any liability to any person or entity with respect to any loss or damage caused or alleged to be caused
directly or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com .
373153904.039.png 373153904.040.png 373153904.041.png 373153904.042.png 373153904.043.png 373153904.044.png 373153904.045.png 373153904.046.png 373153904.047.png 373153904.048.png 373153904.049.png 373153904.050.png 373153904.051.png 373153904.052.png 373153904.053.png 373153904.054.png 373153904.055.png 373153904.056.png 373153904.057.png 373153904.058.png 373153904.059.png 373153904.060.png
Contents at a Glance
About the Author ................................................................xvii
About the Technical Reviewer ......................................................xix
Acknowledgments ...............................................................xxi
Introduction ....................................................................xxiii
PART 1 ■■■ Getting Started
Mapping the Java Jungle .......................................3
CHAPTER 2
Shrinking Java to Fit ...........................................19
CHAPTER 3
Getting Started with the NetBeans IDE .........................33
Intermezzo
PART 2 ■■■ CLDC Development with MIDP
Introducing MIDlets ............................................83
CHAPTER 5
Building User Interfaces .......................................97
CHAPTER 6
Storing Data Using the Record Store ..........................133
CHAPTER 7
Accessing Files and Other Data ...............................161
CHAPTER 8
Using the Java Mobile Game API ..............................193
Intermezzo
PART 3 ■■■ CDC Development
Introducing Xlets and the Personal Basis Profile ...............223
CHAPTER 10 Introducing Applets and the Advanced Graphics
and User Interface ............................................253
CHAPTER 11 Using Remote Method Invocation .............................273
iv
CHAPTER 1
CHAPTER 4
CHAPTER 9
373153904.061.png 373153904.062.png 373153904.063.png 373153904.064.png 373153904.065.png 373153904.066.png 373153904.067.png 373153904.068.png 373153904.070.png 373153904.071.png 373153904.072.png 373153904.073.png 373153904.074.png 373153904.075.png 373153904.076.png 373153904.077.png 373153904.078.png 373153904.079.png 373153904.081.png 373153904.082.png 373153904.083.png 373153904.084.png
Intermezzo
PART 4 ■■■ Communicating with the
Rest of the World
CHAPTER 12 Accessing Remote Data on the Network .......................293
CHAPTER 13 Accessing Web Services ......................................331
CHAPTER 14 Messaging with the Wireless Messaging API ..................373
Intermezzo
PART 5 ■■■ Other Java ME Interfaces
CHAPTER 16 Rendering Multimedia Content ................................447
CHAPTER 17 Finding Your Way .............................................499
CHAPTER 18 Seeking a Common Platform ..................................523
A PPENDIX
Finding Java APIs .............................................539
INDEX .......................................................................543
v
CHAPTER 15 Securing Java ME Applications ................................413
373153904.085.png 373153904.086.png 373153904.087.png 373153904.088.png 373153904.089.png 373153904.090.png 373153904.092.png 373153904.093.png 373153904.094.png 373153904.095.png 373153904.096.png 373153904.097.png 373153904.098.png 373153904.099.png 373153904.100.png 373153904.101.png 373153904.103.png 373153904.104.png 373153904.105.png 373153904.106.png 373153904.107.png 373153904.108.png
Contents
About the Author ................................................................xvii
About the Technical Reviewer ......................................................xix
Acknowledgments ...............................................................xxi
Introduction ....................................................................xxiii
PART 1 ■■■ Getting Started
CHAPTER 1 Mapping the Java Jungle ....................................3
Introducing the Market for Java ME .................................3
Looking from the Device Manufacturers’ Perspective .............3
Looking from the Operators’ Perspective .......................4
Looking from the Consumers’ Perspective ......................5
Looking Inside the Java ME Platform ................................6
Justifying the Need for a Mobile Edition of Java .................6
Making Java Work on Mobile Devices ..........................7
Understanding Configurations .....................................10
Introducing the Connected Limited Device Configuration .........10
Introducing the Connected Device Configuration ................12
Understanding Profiles ...........................................12
Introducing the Mobile Information Device Profile ...............13
Introducing the Foundation Profile ............................14
Introducing the Personal Basis Profile .........................14
Introducing the Personal Profile ..............................15
Understanding Packages .........................................15
Planning Your Approach to Java ME Development ...................16
Selecting Appropriate Device Targets .........................16
Marketing and Selling Your Application ........................17
Wrapping Up ....................................................18
vii
373153904.109.png 373153904.110.png 373153904.111.png 373153904.112.png 373153904.002.png 373153904.003.png 373153904.004.png 373153904.005.png 373153904.006.png 373153904.007.png 373153904.008.png 373153904.009.png 373153904.010.png 373153904.011.png 373153904.013.png 373153904.014.png 373153904.015.png 373153904.016.png 373153904.017.png 373153904.018.png 373153904.019.png 373153904.020.png
Zgłoś jeśli naruszono regulamin