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:
- I was not able to get location using the above device configuration. I ran this test for 15+ mins.
- Then I turned on 3G data and I was getting the location.
- Post this, again I turned off the 3G, I was still able to get location with varying accuracy.
Testcase 2: (Continued post testcase1)
- Post testcase 1, I was getting the location consistently at office location.
- Then I travelled home and when I checked location in basement (-1 floor), I have got location with accuracy of ~900m for the first reading and no location for second and further readings. This continued for 20 odd mins.
- After 20 mins, I started receiving locations.
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)