i use the following code for getting the current latitude and longitude in services but it always return null. please help me.
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
provider = locationManager.getBestProvider(criteria, false);
System.out.println("provider "+provider);
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
Use this piece of code may be it may help you
This is my code
First
startGpsCallBack, thenstopit and then callstartGPSCallBackAgainmethodCheck it and let me know if this solves your problem