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.
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.