Motorola AT Commands G24-L Informations techniques Page 64

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 84
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 63
Standard Classes Deviations
5-22 G24 KJAVA User’s Guide July 15, 2008
// display location results
coordinates = location.getQualifiedCoordinates();
float altitude = coordinates.getAltitude();
double latitude = coordinates.getLatitude();
double llongitude = coordinates.getLongitude();
Example of Periodical Listening for Location Update in Java MIDlet:
// Set criteria for selecting a location provider:
// accurate to 500 meters horizontally
Criteria criteria = null;
criteria = new Criteria();
criteria.setHorizontalAccuracy(500);
// open selected by OSC serial port (UART1 or UART2)
provider = LocationProvider.getInstance(criteria);
// Define Location listener with 4 seconds Location data update
provider.setLocationListener(this, 4, -1, -1);
...
// Listener method
public void locationUpdated(LocationProvider provider, Location location)
{
QualifiedCoordinates coordinates = null;
// display location results
coordinates = location.getQualifiedCoordinates();
float altitude = coordinates.getAltitude();
double latitude = coordinates.getLatitude();
double llongitude = coordinates.getLongitude();
}
Note: Orientation and ProximityListener classes of JSR179 are not implemented in G24
Location API.
Vue de la page 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 83 84

Commentaires sur ces manuels

Pas de commentaire