In my app, i need to create an android service to periodically get mobile user\'s current location(latitude and longitude). The service should get user\'s location in every 5 mi
You can write a private/internal class(within your service) that implements locationListener and in the onStart meethod of your service you can requestLocationUpdates which will be listened by your listener
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
MyLocationListener listener = new MyLocationListener();
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime, minDistance, listener);