Code example for GeomagneticField

Methods: getDeclination

0
	} 
 
	@Override 
	public void onLocationChanged(Location loc) {
		//calculate and store declination for compass offsetting to true north 
        GeomagneticField gmf = new GeomagneticField(
            (float)loc.getLatitude(), (float)loc.getLongitude(), (float)loc.getAltitude(), System.currentTimeMillis());
        this.declination = gmf.getDeclination();
	} 
 
	@Override 
	public void onProviderDisabled(String provider) {
		// TODO Auto-generated method stub 
		 
	} 
 
	@Override 
	public void onProviderEnabled(String provider) {
		// TODO Auto-generated method stub 
		 
	}