How to get current location in android?
i. Use either GPS location provider or Network location provider to fetch the current location of a phone, in terms of latitude and longitude.
ii. Use LocationManager class, and LocationListener class to fetch locations. Use requestLocationUpdates to register locationlistener with locationmanager object.
iii. When ever location gets changed, location manager will automatically call onLocationChanged() method of locationlistner.
iv. Use ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions in the manifest file.
Back To Top