I am developing an Android app which uses the current user location for result.
I am using the following code to get the location:
LocationManager locationManager =
(LocationManager) getSystemService(LOCATION_SERVICE);
Location currentLocation =
locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
When I run it on device it gives me a null value for location.
But when I use the NETWORK_PROVIDER it works fine is there any extra setting for the device to use GPS?
My device is Galaxy Tab P-1000.
Use:
For locationListener you may use this:
I have used this in my code and it works well.