LBS Support in KToolbar

Back | Tutorial Home | Next

Use Sun JavaTM Wireless Toolkit for CLDC Version 2.5.1 and above for LBS applications. If you are using earlier versions then the installation procedure is very difficult and tedious. So it is advised that you download the latest version of WTK from http://java.sun.com/javame.

WTK 2.5.1 comes with good support for creating virtual locations and landmarks. In this section we will look at the support for creating positions only, The landmark support in WTK is covered in “Landmarks and Landmark Store” section.

Create Locations in KToolbar

Run your Location aware Application in the WTK to open an emulator window.
In the Emulator window menu go to MIDlet > External events. A new External events window opens as shown in the picture below.

This window can be used to set all the location values manually. You can also load the xml script and play this file to emulate a moving mobile phone. The format of this xml file is

<waypoints>

<waypoint time="1500" latitude="14.389796708964603"
 longitude="50.09985002736201" altitude="310" />

<waypoint time="5500" latitude="14.390283327582706" longitude="50.099909292742595" altitude="310" />
</waypoints>

You can add any number of waypoint tags to this xml file each waypoint consists of time, latitude, longitude and altitude.

You can also use a sample script that comes with WTK sample “CityGuide”. This script is at location “<WTK_HOME>\apps\CityGuide\citywalk.xml”.

Setting Accuracy in KToolbar

You can set horizontal and vertical accuracy depending on your device’s capability in WTK. To set these parameters got to “Edit>Preferences” in the Ktoolbar menu.

 

j2meSasa goodies
Download demo code for deploying directly to WTK Click here to download Zip File Containing WTK compatible file structure. This zip file is a MIDlet suite of all the examples in this in this LBS tutorial

Back | Tutorial Home | Next

site comments powered by Disqus

More Tutorials

MIDP Basics
MIDP Gaming

This page is a part of a frames based web site. If you have landed on this page from a search engine click here to view the complete page.