Blackberry JAVA DEVELOPMENT ENVIRONMENT - - GPS AND MAPS - DEVELOPMENT GUIDE Manuale Utente Pagina 12

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 30
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 11
12
GPS and BlackBerry Maps Development Guide
2. Perform one of the following sets of tasks:
3. Invoke LocationProvider.getInstance(), storing the returned object in a LocationProvider object.
LocationProvider provider = LocationProvider.getInstance(criteria);
Get GPS location information
GPS location information might be unavailable if the BlackBerry® device cannot receive signals from GPS
satellites. This situation can occur when something is obstructing the signals, such as buildings or dense clouds.
Task Steps
Get accurate location information
using the GPS receiver on a
BlackBerry device with no cost and
no power consumption.
1. Invoke criteria.setHorizontalAccuracy(int accuracy) using an integer value
that represents the accuracy, in meters.
criteria.setHorizontalAccuracy(50);
2. Invoke criteria.setVerticalAccuracy(int accuracy)using an integer value that
represents the accuracy, in meters
.
criteria.setVerticalAccuracy(50);
3. Invoke criteria.setCostAllowed(false).
criteria.setCostAllowed(false);
Get accurate location information
using the GPS receiver on a
BlackBerry device with cost and
variable power consumption.
1. Invoke criteria.setHorizontalAccuracy(int accuracy) using an integer value
that represents the accuracy, in meters.
criteria.setHorizontalAccuracy(50);
2. Invoke criteria.setVerticalAccuracy(int accuracy)using an integer value that
represents the accuracy, in meters
.
criteria.setVerticalAccuracy(50);
3. Invoke criteria.setCostAllowed(true).
criteria.setCostAllowed(true);
4. Invoke criteria.setPreferredPowerConsumption(int level)using one of
POWER_USAGE_LOW, POWER_USAGE_MEDIUM,or NO_REQUIREMENT as the parameter.
criteria.setPreferredPowerConsumption(POWER_USAGE_MEDIUM);
Get approximate location
information using the GPS receiver
on a BlackBerry device with no cost
and variable power consumption.
1. Invoke criteria.setHorizontalAccuracy(NO_REQUIREMENT).
criteria.setHorizontalAccuracy(NO_REQUIREMENT);
2. Invoke criteria.setVerticalAccuracy(NO_REQUIREMENT).
criteria.setVerticalAccuracy(NO_REQUIREMENT);
3. Invoke criteria.setCostAllowed(false).
criteria.setCostAllowed(false);
4. Invoke criteria.setPreferredPowerConsumption(int level)using one of
POWER_USAGE_MEDIUM, POWER_USAGE_HIGH, or NO_REQUIREMENT as the parameter.
criteria.setPreferredPowerConsumption(POWER_USAGE_MEDIUM);
Task Steps
Specify a response time for getting the
location of the BlackBerry device.
>Invoke Criteria.setPreferredResponseTime(), and specify the response time, in
milliseconds.
Vedere la pagina 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 29 30

Commenti su questo manuale

Nessun commento