Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why android GPS is not able to find location untill google map is on even if my phone supports A-GPS

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

like image 538
Sangeeta Rawat Avatar asked Nov 11 '22 20:11

Sangeeta Rawat


1 Answers

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.

like image 131
xizzhu Avatar answered Nov 15 '22 06:11

xizzhu