Blackberry JAVA DEVELOPMENT ENVIRONMENT - - GPS AND MAPS - DEVELOPMENT GUIDE Manual page 20

Version: 4.7.0
Table of Contents

Advertisement

Development Guide
4.
Place the items from the contact list into an enumeration.
Enumeration enumContact = contactList.items();
int notFinished
5.
Create a While loop to iterate through all the items in the enumeration.
while ((enumContact.hasMoreElements())
c = (Contact)enumContact.nextElement();
int[]
fieldIds = c.getFields();
int
id;
6.
Search for the first contact with a valid city and region and display the address information for this contact in the BlackBerry®
Maps.
if (c.countValues(Contact.ADDR) > 0) {
String address[] = c.getStringArray(Contact.ADDR,0);
if ((address[Contact.ADDR_LOCALITY] != null) && (address
[Contact.ADDR_REGION] != null)) {
MapsArguments(c,0));
}
}
}
} catch (PIMException e) {
}
7.
If a contact address is not found, display the default map in the BlackBerry Maps.
if
© == null) {
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments());
}
}
};
View a sample application that displays the location for an address in the contact list
Before you begin:
On a BlackBerry® device, open the contact list. If there are no addresses in the contact list, the sample will display the default
view in the BlackBerry® Maps.
1.
Open the BlackBerry® Integrated Development Environment.
2.
Launch the BlackBerryMapsDemo project.
3.
In the BlackBerry Smartphone Simulator, click BlackBerry Maps Demo.
4.
Open the menu and click Invoke Contact.
5.
Open the menu and click View Map.
18
= 1;
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new
notFinished = 0;
Displaying location information on a BlackBerry device
&& ( notFinished == 1)) {

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the JAVA DEVELOPMENT ENVIRONMENT - - GPS AND MAPS - DEVELOPMENT GUIDE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Gps and blackberry maps

Table of Contents