-1

I want to get elevation(latitude, longitude and altitude) of the device in Android(using Java).

  1. Is there any possibility to get above details without using internet?
  2. Is there any possibility to get above details without using google api?
  3. how the system generates altitude details, if the altitude is -80.555 means how can I handle that measurement, it is meter (or others measurement) from the earth or meter (or others measurement) from the sea level?
James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

1
  1. You can get location information (latitude, longitude and altitude) without having internet, all you need to have a GPS sensor enabled Android device.

  2. Similarly, using GoogleAPIClient is not mandatory to receive location information from Android. Just use GPS_PROVIDER as the provider in LocationManager to get location updates from GPS sensor.

  3. As per Android documentation, the getAltitude() method of Location object returns:

Get the altitude if available, in meters above the WGS 84 reference ellipsoid.

That means the altitude value is in meters and follows a standard geodetic system named WGS 84. That system generates the value by referencing an ellipsoid model of the Earth. As per the wiki documentation, this model calculates the altitude or elevation (also called ellipsoidal height) with reference to the Earth's center of the mass.

If you wish to convert this altitude value to be compared to sea level, there is a good discussion over here how to do this.

sourav.bh
  • 467
  • 1
  • 7
  • 20