I am trying to build a test app which shows the current position @ google maps. The Android Docs say that the emulator simulates a journey somewhere in san francisco. But all I get vom getLatitude() and getLongitude() is just "0.0".
Here's the code with the test output I used (which is always "Lat: 0.0 - Lon: 0.0"):
Using java Syntax Highlighting
- LocationManager myLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
- Location gpsLocation = myLocationManager.getCurrentLocation("gps");
- Double lat = gpsLocation.getLatitude() * 1E6;
- Double lon = gpsLocation.getLongitude() * 1E6;
- TextView txt = (TextView)findViewById(R.id.txt);
- txt.setText("Lat: " + lat + " - Lon: " + lon);
Parsed in 0.037 seconds, using GeSHi 1.0.8.4
Does someone have the same problem or did I just miss something? :S




