Changes

Jump to: navigation, search

Teams Winter 2011/team1/BlackBerry/Add Mapping Option

675 bytes removed, 21:01, 12 April 2011
no edit summary
=== 10. Add Mapping Option ===
'''*NOTE:''' In order to test this feature the application need to newest version of the simulator must be uploaded to the deviceinstalled<br/>
10.1. In order to implement Address Locator we need to add address field and getter/setter methods to <code>Student</code> class:
<source lang="java">
{
String address = student.getAddress();
//start coordinates
showAddress(address);
new Thread(new Runnable(){
public void run(){
try{ Coordinates co Landmark[] landm = new CoordinatesLocator.geocode(45.423488, -75.697929address, 0null);
Landmark[] landm MapsArguments ma = Locator.geocodenew MapsArguments(address, co); //Get latitude and longitude double lon = landm[0].getQualifiedCoordinates().getLongitude()*10000.0 ; double lat = landm[0].getQualifiedCoordinates().getLatitude()*10000.0; //create mapview MapView mapView = new MapView(); mapView.setLatitude((int)lat); mapView.setLongitude((int)lon); mapView.setZoom(10); // Invoke maps application for current Contact Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments(mapView)ma); } catch(LocatorException ex){ Dialog.alert("Cannot find location: " + ex.getMessage()); } catch(Exception ex){ Dialog.alert("Exception when getting location: " + ex.getMessage()); }
}
}).start();
[[Image: BB_map1.png | 300px]]
[[Image: BB_map2.png | 300px325px]]
1
edit

Navigation menu