Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0

Get PDF Book Print View

Document Information

Getting Started

Java ME Platform SDK Features

Using Sample Projects

Creating and Editing Projects

Viewing and Editing Project Properties

Running Projects in the Emulator

Searching the WURFL Device Database

Finding Files in the Multiple User Environment

Profiling Applications

Monitoring Network Traffic

Lightweight UI Toolkit

Security and MIDlet Signing

BD-J Support

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator

On-device Debugging

Command Line Reference


JSR Support

JSR 75: PDA Optional Packages

JSR 82: Bluetooth and OBEX Support

JSR 135: Mobile Media API Support

JSR 172: Web Services Support

JSR 177: Smart Card Security (SATSA)

JSR 179: Location API Support

JSRs 184, 226, and 239: Graphics Capabilities

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 238: Mobile Internationalization API (MIA)

Setting the Emulator's Locale

Using the Resource Manager

Working With Locales

Working With Resource Files

Working With Resources

Running i18nDemo

JSR 229: Payment API Support

JSR 256: Mobile Sensor API Support


Running i18nDemo

This MIDlet suite demonstrates the JSR 238 Mobile Internationalization API. The MIDlets String Comparator and Formatter show how to sort strings and display numbers appropriately for different locales. The third MIDlet, MicroLexicon, is a small phrase translator that comes in handy if you need to ask for a beer in Prague, Herzliya, Beijing, Milan, or several other locations.

Note - The default fonts for the Java ME Platform SDK do not support Chinese and Japanese. To use these languages, follow these steps before running this demo: 1. Install a True Type font that supports Chinese or Japanese. 2. Modify installdir\toolkit-lib\devices\skin-directory\conf\skin.properties to specify that font.

To run a MIDlet, highlight the MIDlet, then use the Launch soft button to run the MIDlet.

String Comparator

The String Comparator MIDlet demonstrates how strings (city names) are sorted differently depending on locale. Launch the MIDlet. Use the Menu soft button to view the menu. Click or Type 2 to select Sort - default, and the list is sorted alphabetically. Click or Type 3 to select Sort - slovak. It’s easy to see the difference in the cities that begin with the letter Z, with and without the mark on top. Click Exit to return to the list of MIDlets.


The second MIDlet, Formatter, simply displays times and numbers formatted for different locales. Click next to view all four screens. Click Exit to return to the list of MIDlets.


The final MIDlet, MicroLexicon, translates phrases from one language to another language. To set the source language, follow the steps in Setting the Emulator's Locale.

To select the target language from the list, use the navigation arrows to highlight Choose Language. Click the Select button to view the language drop down. Use the navigation arrows to choose a language and then click Select. Click the Next soft button.

MicroLexicon displays a list of phrases. Highlight one and press the Select button on the emulator.

MicroLexicon displays the flag of the target language and the translated phrase.

MicroLexicon is powered by MIDlet resources. To understand how you can use the Java ME Platform SDK to localize an application, choose Tools > i18n Resources Manager. All the resources, both text and images, used by MicroLexicon, appear. You can edit the resources and run MicroLexicon again to see what happens.

i18n Resources Manager displaying the resources in the i18bDemo project directory

To practice creating and editing resources, see Working With Resource Files.

The resources are stored in the project’s JAR file.