I have make an android application which help us to get GPS Location using A-gps in my android phone. I am getting latitude and longitude successfully in Metro Cities of my country, but when I am going to some forest area,GPS do not get location and for this I need to run GPRS of my phone,after running google map once in my phone ,GPS successfully gets latitude and longitude even if I closes my internet connection or remove sim card from my phone. But since I do not want to use google map, what should I do now and why it is happening?? Any help will be appreciable
It takes a long time (several minutes) to get the GPS location with high precision. However, if you enable network based location (e.g. cell tower, WiFi), it's way faster but with lower precision.
As a result, you should listen to all the providers with LocationManager
, and figure out which provides the best location. Or, if your app targets Android 8 and above, you can use the Location APIs provided with Google Play Services, which hides the details as using LocationManager
directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With