n76 / wifi_backend

Local (phone only) WiFi AP location provider for microG project's unified network location provider
GNU General Public License v3.0
59 stars 11 forks source link

NOTICE

The author of this backend is now primarily focused on the Déjá Vu backend. Bug fixes and pull requests will be accepted for this backend but it will not be as well supported as Déjá Vu going forward.

Local WiFi Backend

UnifiedNlp backend that uses locally acquired WiFi AP data to resolve user location.

This backend consists of two parts sharing a common database. One part passively monitors the GPS. If the GPS has acquired and has a good position accuracy, then the WiFi APs detected by the phone are stored.

The other part is the actual location provider which uses the database to estimate location when the GPS is not available. The use of stored WiFi AP can decrease the GPS time to first fix and allows apps to get an immediate approximate location.

This backend uses no network data. All data acquired by the phone stays on the phone and no queries are made to a centralized WiFi AP location provider.

Get it on F-Droid

Requirement for building

  1. Building requires Android SDK with API 19 or higher.

Requirements on phone

  1. This is a plug-in for µg UnifiedNlp which can be installed from f-droid. The µg GmsCore can also use this backend.

How to build and install

Using Android Studio, select Build->"Generate Signed APK..."

Setup on phone

In the NLP Controller app (interface for µg UnifiedNlp) select the "WiFi Location Service". If using GmsCore, then the little gear at microG Settings->UnifiedNlp Settings->Configure location backends->WiFi Location Service is used.

Advanced Settings

Collecting WiFi AP Data

To conserve power the collection process does not actually turn on the GPS. If some other app turns on the app, for example a map or navigation app, then the backend will monitor the location and collect WiFi data.

What is stored in the database

For each WiFi AP the bssid and, if set, the ssid are stored along with up to three sets of latitude/longitude samples. There is also a "moved" indicator set if it appears the AP may have moved.

The ssid is stored for display only and is irrelevant to actual function of this software.

The algorithm attempts to determine the outer edge of the coverage area a WiFi AP by saving the three samples that give the largest reasonable circle within which the AP is detected. The logic behind this was to reduce identifiable "bread crumb" trails for data collected by stumblers and may not be ideal.

Export and Import of WiFi (WLAN) Access Point (AP) data

Clearing the database

To clear or reset database, touch the "Reset Database" in the backend setting.

Libraries Used

Other IP used

Icon created with the Android Asset Studio (Creative Commons Attribution 3.0 Unported License).

Notification icon created with the Android Asset Studio (Creative Commons Attribution 3.0 Unported License).

Changes

History is now a separate file

License

Copyright (C) 2014, 2015, 2016 Tod Fitch

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.