Do Android devices need internet when using network provider for location fetching? I see few articles saying it works without internet and few saying it needs internet.
I am looking more into how Android internally does location fetching (rather than the code).
Articles saying we need internet: Device captures cell id and wifi hotspots and sends it to google server. And google server returns the location information. These articles are saying we need internet to get location.
Few articles are saying location is determined using cellular triangulation and no internet is needed.
I have tried to do test to confirm the same. But test results are confusing and could not deduce anything from the same.
Device configuration: I have turned off internet, wifi scan and GPS. This means device had only cellular signal. Application captures location every minute.
Test result 1:
Testcase 2: (Continued post testcase1)
How exactly do network location works. I am looking more at how Android internally does location fetching rather than the code.
So here are my questions:
- Does it pass cellid and wifi hotspots and get location (using internet)?
- Does it do cellular triangulation?
- Does it cache data and use accelerometer and compass to determine location without internet?
(Though there are similar questions in stackoverflow. They are more into code rather than the Android internal working. Hence posting this question)
When developing a location-aware application for Android, you can utilize GPS and Android's Network Location Provider to acquire the user location. Although GPS is most accurate, it only works outdoors, it quickly consumes battery power, and doesn't return the location as quickly as users want.
Android's Network Location Provider determines user location using cell tower and Wi-Fi signals
, providing location information in a way that works indoors and outdoors, responds faster, and uses less battery power. To obtain the user location in your application, you can use both GPS and the Network Location Provider, or just one.
If you are using both NETWORK_PROVIDER and GPS_PROVIDER, then you need to request only the permission ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION includes permission only for NETWORK_PROVIDER
depending on the permission which you are using may give the different results
check these website and strategies used by android for location
depending on the comments of Anil vk
network –> (AGPS, CellID, WiFi MACID)
: This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup. Requires either of the permissions android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.
the answer is yes
it depends on the signal strength from cell tower to get accurate results you can see this website for accuracy and battery draining issues by using different ways.
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