2011年4月25日 星期一

NMEA資訊

NMEA資訊
    // get location service
    LocationManager location = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
    // set location update settings(time...)
     location.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,new LocationListener(){
        public void onLocationChanged(Location loc) {}
        public void onProviderDisabled(String provider) {}
        public void onProviderEnabled(String provider) {}
        public void onStatusChanged(String provider, int status,Bundle extras) {}
    });
    // listen the NMEA information when change
    location.addNmeaListener(new NmeaListener() {
        public void onNmeaReceived(long timestamp, String nmea) {
            msg.append(nmea);
        }
    });

沒有留言:

張貼留言