Android: Using Wi-Fi as a Location Provider

As I understand it, I have three providers to choose from: GPS, Network and Passive.

I want to get my location by discovering the Wi-Fi network I'm connected to. I believe that cell location and Wi-Fi positioning apply to the network provider.

However, despite connecting to a Wi-Fi access point, my program, as a rule, uses cell triangulation rather than Wi-Fi to determine my location (assumed based on the huge inaccuracy of the returned coordinates).

Doesn't seem like any way to force Wi-Fi? How will Android decide when to use Wi-Fi over cell triangulation?

+3
source share
1 answer

I think it uses wifi when the wifi information scanned from the wifi chipset matches the data from a remote Google database (I don't know about this database, but it should include all cities with StreetView). Otherwise, he uses a much less accurate triangulation of cells.

To check which type is used, you can try LocationProvider.requireCell() (did not test it ...)

0
source

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


All Articles