magnetic declination android studio
public void setLocation(Location location)
{
GeomagneticField geomagneticField = new GeomagneticField(
(float) location.getLatitude(),
(float) location.getLongitude(),
(float) location.getAltitude(),
System.currentTimeMillis());
declination = (float) Math.toRadians(geomagneticField.getDeclination());
}
}