Javatm Platform Micro Edition Software Development Kit
Total Page:16
File Type:pdf, Size:1020Kb
JavaTM Platform Micro Edition Software Development Kit Version 3.0 Sun Microsystems, Inc. www.sun.com April 2009 [email protected] Copyright © 2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. This distribution may include materials developed by third parties. Sun, Sun Microsystems, the Sun logo, Java, JavaFX, Java 2D, J2SE, Java SE, J2ME, Java ME, Javadoc, JavaTest, JAR, JDK, NetBeans, phoneME, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. or its subsidiaries in the U.S. and other countries. Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited. DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright © 2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, États-Unis. Tous droits réservés. Sun Microsystems, Inc. détient les droits de propriété intellectuels relatifs à la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plus des brevets américains listés à l'adresse http://www.sun.com/patents et un ou les brevets supplémentaires ou les applications de brevet en attente aux États - Unis et dans d'autres pays. Utilisation est soumise aux termes du contrat de licence. Cette distribution peut inclure des éléments développés par des tiers. Sun, Sun Microsystems, le logo Sun, Java, JavaFX, J2SE, Java 2D, Java SE, J2ME, Java ME, Javadoc, JavaTest, JAR, JDK, NetBeans, phoneME, and Solaris sont des marques de fabrique ou des marques déposées enregistrées de Sun Microsystems, Inc., ou ses filiales, aux États-Unis et dans d'autres pays. Les produits qui font l'objet de ce manuel d'entretien et les informations qu'il contient sont régis par la législation américaine en matière de contrôle des exportations et peuvent être soumis au droit d'autres pays dans le domaine des exportations et importations. Les utilisations finales, ou utilisateurs finaux, pour des armes nucléaires, des missiles, des armes biologiques et chimiques ou du nucléaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou réexportations vers des pays sous embargo des États-Unis, ou vers des entités figurant sur les listes d'exclusion d'exportation américaines, y compris, mais de maniéré non exclusive, la liste de personnes qui font objet d'un ordre de ne pas participer, d'une façon directe ou indirecte, aux exportations de des produits ou des services qui sont régi par la législation américaine sur le contrôlé des exportations et la liste de ressortissants spécifiquement désignes, sont rigoureusement interdites. LA DOCUMENTATION EST FOURNIE "EN L'ÉTAT" ET TOUTES AUTRES CONDITIONS, DÉCLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISÉE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE À LA QUALITÉ MARCHANDE, À L'APTITUDE À UNE UTILISATION PARTICULIÈRE OU À L'ABSENCE DE CONTREFAÇON. Please Recycle Contents 1. Getting Started 1 Quick Start 1 Tips for Legacy Toolkit Users 2 2. Java ME Platform SDK Features 5 Emulation Platforms 5 CLDC and MIDP Stack 6 CDC Stack 6 BD-J Stack 7 JavaFX Platform 7 Managing Java Platforms 8 J2SE and CDC Platforms 9 J2ME Platforms (CLDC and MIDP) 9 Adding a Java Platform 9 Selecting a Platform Type 10 Choose Platform Folder and Name (Java SE and CDC) 10 Choose Location (JavaSE and CDC) 11 Create a Platform for Legacy CDC Projects 11 Choose Java ME MIDP Platform Folders 11 Choose Custom Java ME MIDP Platform Emulator 12 Support for Third-Party Emulators and Real Devices 13 Automatic Update 14 Using the Plugins Manager 14 Installing a Plugin Globally 16 3. Using Sample Projects 19 Running a Project 19 [email protected] Troubleshooting 21 Sample Project Overview 21 Configuring the Web Browser and Proxy Settings 24 Resolving Reference Problems 24 Running MIDP and CLDC Sample Projects 25 Running the Demos Sample Project 26 Running FPDemo 32 Running Games 32 Running Network Demo 33 Running PhotoAlbum 34 Running UIDemo 34 4. Creating and Editing Projects 37 About Projects 38 CLDC Projects 38 CDC Projects 39 Creating a CLDC Project 40 Choose Project 40 Name and Location 41 Platform Selection 41 Specify WTK Project 42 Creating a CDC Project 42 Choose Project (CDC) 43 Platform Selection (CDC) 44 Specify CDC Toolkit Project 44 Working With Projects 44 Viewing Project Files 45 Creating a New MIDlet 46 Importing MIDP Projects 47 Importing CDC Projects 47 Adding Files to a Project 48 Find in Files 48 5. Viewing and Editing Project Properties 51 Viewing General Project Properties 52 Selecting a Platform 52 Editing Application Descriptor Properties 53 CDC Attributes 53 MIDP Attributes 53 MIDlets 54 Push Registry 56 API Permissions 57 Building a Project 57 Configuring Ant 58 Compiling 59 Adding Libraries and Resources 59 Creating JAR and JAD Files (Packaging) 60 Obfuscating 60 Signing 60 Exporting a Key 61 Running Settings 62 Running a MIDP Project 62 Running a CDC Project 62 6. Running Projects in the Emulator 65 Understanding the Emulator 65 Viewing Device Properties 66 Platform Properties 67 Device Information 67 Device Properties 67 Setting Device Properties 68 Running a Project from the Device Selector 68 Running Projects Simultaneously on a Single Device 69 Emulator Options 70 Adding a Device Instance 71 7. Searching the WURFL Device Database 73 Searching for Devices 73 Filtering the WURFL Search 75 8. Finding Files in the Multiple User Environment 77 Switching Users 77 Installation Directories 78 User Directories 79 /javame-sdk 79 /javame-sdk/3.0/work 80 /javame-sdk/toolbar/3.0 80 /JavaMESDKProjects 80 9. Profiling Applications 81 Saving Profiler Data 81 Loading Profiler Data 83 Viewing Profiler Data 83 Saving Customized Snapshots and Images 86 Loading a Customized Snapshot 86 10. Monitoring Network Traffic 87 Using the Network Monitor 87 Filtering Messages 89 Sorting Messages 89 Saving and Loading Network Monitor Information 90 Clearing the Message Tree 90 11. Lightweight UI Toolkit 91 Adding the LWUIT Library 91 Using the LWUIT Resource Manager 92 12. Security and MIDlet Signing 93 Security Domains 94 Setting Security Domains 95 Specifying the Security Domain for an Emulator 95 Specifying the Security Domain for a Project 95 Signing a Project 95 Managing Keystores and Key Pairs 96 Working With Keystores and Key Pairs 97 Managing Root Certificates 99 13. BD-J Support 101 Creating a Stubs for BD-J Platform Project 101 Compiling, Deploying, and Running a Stubs for BD-J Platform Project 103 14. CLDC Emulation on a Windows Mobile Device 105 CLDC Emulator Installation for a Device Running Windows Mobile 105 Testing On-device Debugging 115 15. Installing CLDC Emulation on a Windows Mobile Emulator 117 CLDC Installation for Windows Mobile 117 16. On-device Debugging 127 On-device Debugging Procedure 127 Attach a Command Line Debugger 128 Attach a Graphical Debugger 128 Sample CLDC Debugging Session 129 17. Command Line Reference 131 Launching the SDK 132 Running the Device Manager 132 Managing Device Addresses (device-address) 133 Running the Emulator From the Command Line 133 MIDlet Options 134 CDC Options 136 Debugging and Tracing Options 136 Building a Project from the Command Line 137 Checking Prerequisites 138 Compiling Class Files 138 Preverifying Class Files 138 Packaging a MIDLet Suite (JAR and JAD) 139 Command Line Security Features 140 Changing the Emulator’s Default Protection Domain 141 Signing MIDlet Suites (jadtool.exe) 141 Managing Certificates (MEKeyTool) 142 Generating Stubs (wscompile) 143 Running the Payment Console From the Command Line 145 Virtual Machine Memory Profiler (Java Heap Memory Observe Tool) 145 Running the Java Heap Memory Observe Tool 146 Viewing the Heap Snapshot 147 Running WMA Tool 147 smsreceive 148 cbsreceive 148 mmsreceive 148 smssend 150 cbssend 150 mmssend 150 18. Logs 153 Java ME Platform SDK GUI Logs 153 Device Manager Logs 153 Device Instance Logs 154 19. JSR Support 155 JCP APIs 156 20. JSR 75: PDA Optional Packages 159 FileConnection API 159 PIM API 161 Running PDAPDemo 161 Browsing Files 162 The PIM API 164 21. JSR 82: Bluetooth and OBEX Support 167 Bluetooth Simulation Environment 167 OBEX Over Infrared 168 Setting Bluetooth and OBEX Preferences 168 OBEX Preferences 168 Bluetooth Internal Properties 168 Bluetooth System Properties 169 Bluetooth BCC Properties 169 Running the Bluetooth Demo 170 22. JSR 135: Mobile Media API Support 171 Media Types 172 Adaptive Multi-Rate (AMR) Content 172 Media Capture 172 MMAPI MIDlet Behavior 173 Ring Tones 173 Download Ring Tones 173 Ring Tone Formats 173 Running the MMAPI Sample Project 175 Running AudioDemo 175 Running MMAPIDemos 176 Running the Multimedia Sample Project 180 23.