Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid GoogleMaps getting wrong latitude and longitude
    primarykey
    data
    text
    <p>Currently, I am working on GoogleMaps, but I have a problem. E.g when I</p> <p>lat: 22.422006 lng: 23.084095</p> <p>emulator toasts me like : </p> <p>lat: 2.2422006E13 lng: 2.3084095E7</p> <p>I read so many tutorials, and made exactly the same, but I can't handle this problem. </p> <p>Here is my code : </p> <pre><code> public class MainActivity extends MapActivity { public static final String TAG = "GoogleMapsActivity"; private MapView mapView; private LocationManager locationManager; Geocoder geocoder; Location location; LocationListener locationListener; CountDownTimer locationtimer; MapController mapController; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mapView = (MapView)findViewById(R.id.mapView); mapController = mapView.getController(); mapController.setZoom(16); mapView.setBuiltInZoomControls(true); readFromGPS(); } private void readFromGPS() { locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); // Define a listener that responds to location updates locationListener = new LocationListener() { public void onLocationChanged(Location location) { // Called when a new location is found by the network location provider. Toast.makeText(getApplicationContext(), location.getLatitude()*1E6+"-"+location.getLongitude(), Toast.LENGTH_SHORT).show(); } public void onStatusChanged(String provider, int status, Bundle extras) {} public void onProviderEnabled(String provider) { Toast.makeText(getApplicationContext(), "GPS Enabled", Toast.LENGTH_SHORT).show(); } public void onProviderDisabled(String provider) { } }; locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,1000, 0, locationListener); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload