Blackberry GPS and BlackBerry Maps Handbuch - Seite 20
Blättern Sie online oder laden Sie pdf Handbuch für Software Blackberry GPS and BlackBerry Maps herunter. Blackberry GPS and BlackBerry Maps 35 Seiten. Version: 4.7.0
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)) {