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

Logs

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

Setting the Emulator's Location at Runtime

Running the CityGuide Sample Project

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)

JSR 229: Payment API Support

JSR 256: Mobile Sensor API Support

Index

Running the CityGuide Sample Project

CityGuide demonstrates how to use the Location API (JSR 179). It shows a walker’s current position superimposed on a city map. The walker moves around the city and landmarks are highlighted and identified as the walker approaches. In this demo we get the walker’s location from an XML script named citywalk.xml (the event file) that submits the device location information.

Because location prompts occur frequently, it is best to run this demonstration in manufacturer (trusted) mode, as explained in Security Domains. In the user interface, right-click on your project and select the Running category. Select Specify the Security Domain, and select manufacturer or maximum.

Open and run the CityGuide project. In the emulator, launch the CityGuide MIDlet. Click Next to view the map page.

CityGuide demo shows your location in the city

Choose View > External Events Generator from the emulator window menu. On the Location tab click the browse button. Select the following event file in installdir\apps\CityGuide\citywalk.xml.

The player buttons at the bottom of the window are now active. Press the green play button (right-pointing triangle) to run the script.

The display shows four types of landmarks: restaurants, museums, shops, and theaters. To adjust the landmark display, open the soft menu and choose the Settings command.

Use the navigation keys to highlight a category, then use Select to check or uncheck an item.

When you are near a landmark (shown highlighted on the map), open the soft menu and choose the Detail command to see more information. See JSR 179: Location API Support for more details on location scripts.

Location Settings Dialog