Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Průvodce řešením problémů Strana 204

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 286
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 203
204
BlackBerry Java Development Environment Development Guide
Retrieve BlackBerry device GPS location information
Task Steps
Specify a response time for retrieving the
location of the BlackBerry® device.
The time it takes to retrieve the location of the BlackBerry device for the first time depends on
several factors, such as the selected GPS mode and the GPS signal strength. In autonomous
method, typical times are less than 2 minutes. In assisted mode, typical times are less than 30
seconds.
>Invoke Criteria.setPreferredResponseTime(), providing the desired response time
in milliseconds.
Retrieve the location information for a
BlackBerry device.
> In a non-event thread, invoke LocationProvider.getLocation(int), providing a
timeout in seconds.
try {
// Specify -1 to have the implementation use its default timeout value
// for this provider.
Location location = provider.getLocation(-1);
} catch (Exception e) {
// handle LocationException, InterruptedException, SecurityException
// and IllegalArgumentException
}
Retrieve the speed of a BlackBerry
device.
1. Invoke location.getQualifiedCoordinates, storing the returned object in a
QualifiedCoordinates object.
QualifiedCoordinates coordinates = location.getQualifiedCoordinates;
2. Invoke location.getSpeed().
float speed = location.getSpeed();
Retrieve the course of a BlackBerry
device.
1. Invoke location.getQualifiedCoordinates, storing the returned object in a
QualifiedCoordinates object.
QualifiedCoordinates coordinates = location.getQualifiedCoordinates;
2. Invoke location.getCourse().
float course = location.getCourse();
Zobrazit stránku 203
1 2 ... 199 200 201 202 203 204 205 206 207 208 209 ... 285 286

Komentáře k této Příručce

Žádné komentáře