Greetings,
I know this has been discussed over and over now but I just got it
workign and it works perfectly on the emulator when I mock the
location with long and lat however, I am still getting NULL in the
location when I run the code on my phone.
here's the main code
...
// Get my current location
locationListener = new MyLocationListener();
LocationManager manager = (LocationManager) getSystemService
(LOCATION_SERVICE);
manager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
0, 0,locationListener);
Location loc = manager.getLastKnownLocation("gps");
if(loc != null) {
latPoint = manager.getLastKnownLocation("gps").getLatitude
();
lngPoint = manager.getLastKnownLocation("gps").getLongitude
();
// Create a point of it
GeoPoint point = new GeoPoint((int) (latPoint * 1E6), (int)
(lngPoint * 1E6));
// Animate the map to the location
mc.animateTo(point);
mc.setZoom(20);
mapView.setSatellite(true);
mapView.invalidate();
} else {
latPoint = 111.1111111; // means location is Null
}
....
Is it an API issue? because my phone still has firmware 1.0 and I am
waiting for T-mobile to send me the update!
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---