I am trying to get the satellite information from the android and wrote this following code which is not giving any results, could any one point out why is it so?
Try this:
LocationManager locmgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
//locmgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10L, 5.0f, this);
Location location = locmgr.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if ( location == null ) {
location = locmgr.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
}
if ( location == null ) {
location = locmgr.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);
}
Let me know if any issue.