Code example for GeomagneticField

Methods: getDeclination

0
	@Override 
	public void onLocationChanged(final Location location) {
		Log.i("RadarActivity", location.toString());
		mLastLocationMillis = SystemClock.elapsedRealtime();
		mLastLocation = location;
		GeomagneticField geoField = new GeomagneticField(Double.valueOf(location.getLatitude()).floatValue(), Double.valueOf(location.getLongitude()).floatValue(), Double.valueOf(location.getAltitude()).floatValue(), System.currentTimeMillis());
		mRadarView.setDeclination(geoField.getDeclination());
		mMapCenter = location;
		calculateDestinationAndBearing(); 
	} 
 
	@Override 
	public void onStatusChanged(String provider, int status, Bundle extras) {
 
	} 
 
	private int getGPSColor(final int numSatellites) {
		final float frac = 255 / 6f;
		final int a = 0xff;
		final int b = 0x00;
Contextual code suggestions in your IDE  Get Codota for Java