Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0, Mac OS

Get PDF Book Print View
 

Document Information

Getting Started

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

Network Monitoring

Lightweight UI Toolkit

Security and MIDlet Signing

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator (Windows Only)

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

JSR 180: SIP Communications

JSR 184: Mobile 3D Graphics

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 226: Scalable 2D Vector Graphics

JSR 229: Payment API Support

JSR 238: Mobile Internationalization API (MIA)

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: installdir\apps\CityGuide\citywalk.xml.

Windows:

installdir\apps\CityGuide\citywalk.xml

Mac OS:

installdir/Contents/Resources/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.

Location Settings Dialog