Getting the precise location you need the GPS data to be in 8 decimal place.
private void updateDisplay() {
if(mCurrentLocation == null) {
tv3.setText("Determining Your Location...");
} else {
loc[1] = mCurrentLocation.getLatitude();
loc[0] = mCurrentLocation.getLongitude();
tv3.setText("");
tv6.setText(String.format("Lon: %.8f", mCurrentLocation.getLongitude()));
tv7.setText(String.format("Lat: %.8f", mCurrentLocation.getLatitude()));
// get elevation from google
Elevation_Insert("https://maps.googleapis.com/maps/api/elevation/json?locations="+ mCurrentLocation.getLatitude()+","+mCurrentLocation.getLongitude()+"&key=AIzaSyCEhYHn0AQJC7RyfdhUpi3-ff0Qy44E464");
}
}
Getting the precise location you need the GPS data to be in 8 decimal place.