Does your network provider need internet to determine your location?

Do Android devices need internet when using a network provider to determine location? I see several articles that say that it works without the Internet, and few say that it needs the Internet.

I understand more about how Android internally retrieves a location (not code).

Articles about what we need the Internet: the device captures the identifiers of cells and Wi-Fi and sends them to the google server. Google server returns location information. These articles say that we need the Internet to get a place.

Several articles say that location is determined using triangulation of cellular communications, and the Internet is not needed.

I tried to do a test to confirm it. But the test results are confusing and cannot deduce anything from the same.

Device configuration: I turned off the Internet, wifi scan and GPS. This means that the device has only a cellular signal. The application captures the location every minute.

Test result 1:

  • I could not find the location using the above device configuration. I conducted this test for 15 minutes.
  • Then I turned on the 3G data and I got the location.
  • Publish this, I turned off 3G again, I could still get the location with varying accuracy.

Test Record 2: (Continued post testcase1)

  • Post test file 1, I constantly found a place in the office.
  • Then I went home, and when I checked the location in the basement (-1 floor), I have a place with an accuracy of ~ 900 m for the first reading and no place for the second and subsequent readings. This went on for 20 odd minutes.
  • After 20 minutes, I began to receive addresses.

How exactly the network works. I look more at how Android internally selects a location, not a code.

So here are my questions:

  • Does it go through cellular and Wi-Fi hotspots and get a place (using the Internet)?
  • Does it contain tiered triangulation?
  • Does it cache data and use accelerometer and compass to determine location without internet?

(Although there are similar questions in stackoverflow, they are more likely in the code than in the internal workings of Android, so they post this question)

+5
source share
1 answer

your tests display this image

When developing a location application for Android, you can utilize GPS and Android 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. you can utilize GPS and Android 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 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 consumes less battery power. To get the user's location in the 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 resolution you use, they may produce different results.

check out these website and strategies used by android to determine location

depending on comments by Anil vk

network → (AGPS, CellID, WiFi MACID): This provider determines the location based on the availability of cellular points and WiFi access points. Results are retrieved using network search. One of the permissions required is android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.

The answer yes depends on the signal strength from the cell tower, in order to get accurate results, you can see this website to ensure accuracy and battery drain problems using different methods.

+2
source

Source: https://habr.com/ru/post/1247579/


All Articles