[APP] UnifiedNlp - FLOSS Wi-Fi- and cell-tower-based geolocation

Search This thread

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,269
Introduction
UnifiedNlp is a FLOSS (Free/Libre Open Source Software) tool for geolocating android phones without Google's Geolocation service. It allows apps that use Android's coarse or network locating features to geolocate the phone which is usually faster and less battery consuming then GPS. If you use your phone without GAPPS this might become a useful tool for you.
The real location work is done by backends (plug-ins) that can be configured through the UnifiedNlp UI. There is already a number of backends out there that use data from various data sources, some of them working completely offline.
The same backend technique is used for UnifiedNlp's secondary feature: (reverse) geocoding. This allows apps like the android gallery to convert geo-coordinates to an address, resulting in better user experience.
UnifiedNlp is the successor of NOGAPPS NetworkLocation and part of the microG Project.

Installation
UnifiedNlp comes with official support for Android 4.4 (KitKat) and Android 5.0 (Lollipop). Installation on AOSP-based ROMs for this version is easy:
  1. Make sure that no Google geolocation tool is installed (it is usually listed as Google Play Services in Apps)
  2. Download and install NetworkLocation.apk as a usual app (you may need to enable "Unknown sources" in Settings->Security)
  3. Reboot

If your system is not AOSP-based but GAPPS-free and the above instructions do not work for you, try placing NetworkLocation.apk directly in /system/priv-app/ and reboot.

If your system has Xposed, you can use this Xposed module together with UnifiedNlp.apk

Android 2.3 (Gingerbread) through Android 4.3 (Jelly Bean) are not officially supported (meaning newer versions of UnifiedNlp are not tested on these platforms). Still a legacy version is published with every release. Android 4.2+ is known to usually work properly, older versions are often not supported by backends and thus can't use UnifiedNlp. Push LegacyNetworkLocation.apk directly to /system/app and reboot to try it out.

Download
Latest stable release: v1.4.0 - Download NetworkLocation.apk - LegacyNetworkLocation.apk - UnifiedNlp.apk
Older versions and pre-release builds can be found on GitHub

Backends
I developed and will support three backends, that you can find on GitHub:AppleWifiNlpBackend, IchnaeaNlpBackend (Mozilla Location Service), OpenWlanMapNlpBackend and NominatimGeocoderBackend
These and backends by other developers are usually released on F-Droid.
If you installed a third-party backend and you're not sure whether the problem is caused by UnifiedNlp or the backend, feel free to write here.

Upcoming/planned features
- Better status information to check whether installation succeeded or not and what steps might be needed
- Backend prioritization and complex rule system

FAQ
Q: It does not work!
A: Make sure you read the installation instructions properly and that locating would be possible using the backends provided. Are you sure you rebooted? Is your system GAPPS free? OK. Now, ask!

Thanks
Big thanks to everyone who continuously supported me doing this, by donating, pull-requests or just feedback. Thanks to backend developers, that made this tool useful. Thanks to Google for leaving a door in Android that makes this possible.

XDA:DevDB Information
microG UnifiedNlp, App for all devices (see above for details)

Contributors
MaR-V-iN
Source Code: https://github.com/microg/android_packages_apps_UnifiedNlp


Version Information
Status: Stable
Current Stable Version: 1.4.0
Stable Release Date: 2015-09-15

Created 2015-01-02
Last Updated 2015-10-04
 
Last edited:

Ultramanoid

Senior Member
Apr 24, 2011
3,459
5,078
日本
Thank you very much for this.

Just a note to point out that GitHub's mobile site has no downloads anywhere to be seen if one gets there from a smartphone on default mode, and users might get really confused about it. One has to switch to the desktop site to find the backend APKs.
 

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,269
What other apps will be affected by disabling google play services? Want to try this but I have Play services installed.

If you run with play services I guess you installed the complete GAPPS package, including Play Store etc. These either require Play Services or misbehave with Play Services removed or replaced.

However, chances are good that there will be a complete Play Services replacement including UnifiedNlp sometime (sooner or later - no ETA here)
 
Last edited:

Cozmos23

Senior Member
Jan 16, 2014
598
223
What other apps will be affected by disabling google play services? Want to try this but I have Play services installed.
Every APP which requires Google play licensing or the play services. F.e. Google Music
A lot of paid apps f.e. Poweramp will not work

But u are able to download your paid apps in Blank Store f.e. Tasker

Nova Launcher or Atlas Browser and most CM Themes are working fine without gapps even the paid Version.
U can only buy apps on the Play Store Website and you have no option to return the APP.

But if everything is working fine for you then stay with Gapps because it requires a lot of work and knowledge.
But some people like it that way :)
 
  • Like
Reactions: sherpa25

sherpa25

Senior Member
Jun 13, 2011
842
68
Muntinlupa
If you run with play services I guess you installed the complete GAPPS package, including Play Store etc. These either require Play Services or misbehave with Play Services removed or replaced.

However, chances are good that there will be a complete Play Services replacement including UnifiedNlp sometime (sooner or later - no ETA here)

Every APP which requires Google play licensing or the play services. F.e. Google Music
A lot of paid apps f.e. Poweramp will not work

But u are able to download your paid apps in Blank Store f.e. Tasker

Nova Launcher or Atlas Browser and most CM Themes are working fine without gapps even the paid Version.
U can only buy apps on the Play Store Website and you have no option to return the APP.

But if everything is working fine for you then stay with Gapps because it requires a lot of work and knowledge.
But some people like it that way :)
I see, thanks for the info. I use Nova and Phoenix ROM and just selected a few gapps.

I do use Play Store....well, it's the only app I know where to easily get and install apps from (when searching for an app), other than getting an apk elsewhere which I copy and install manually. What are you guys using? I tried browsing and downloading a few times on my phone but they don't work when installing. Probably I need an installer app on my phone? How do you guys manage these installations via the phone? I'd like this so I don't have to keep attaching my phone to the PC and transferring apks to install. Thanks again.
 

mnirun

Member
May 26, 2012
36
17
µg UnifiedNlp works great on Android 4.2.2.

GPS first fix time is faster than Google network location.

Looks like µg UnifiedNlp can save more battery since it's lower wakelock time compare with Google network location.

Screenshot_2015-01-03-22-48-20.png
Screenshot_2015-01-03-22-48-28.png
 

dp_alvarez

Member
May 5, 2014
30
16
Wow, this is awesome! It must have been a LOT of work to get this working, let alone making it stable and usable, thank you! Android is really very usable without gapps now.
Also, here are a couple links to anyone interested in using it completely offline: https://f-droid.org/repository/browse/?fdfilter=Backend&fdid=org.fitchfamily.android.wifi_backend and https://f-droid.org/repository/browse/?fdfilter=Backend&fdid=org.fitchfamily.android.gsmlocation
The wifi backend even updates the local database with nearby APs once it has found a GPS fix, real neat!

---------- Post added at 12:50 AM ---------- Previous post was at 12:39 AM ----------

I see, thanks for the info. I use Nova and Phoenix ROM and just selected a few gapps.

I do use Play Store....well, it's the only app I know where to easily get and install apps from (when searching for an app), other than getting an apk elsewhere which I copy and install manually. What are you guys using? I tried browsing and downloading a few times on my phone but they don't work when installing. Probably I need an installer app on my phone? How do you guys manage these installations via the phone? I'd like this so I don't have to keep attaching my phone to the PC and transferring apks to install. Thanks again.

I use F-Droid and Aptoide. Aptoide really has a LOT of software, highly recommended. It is a fork of F-Droid if I'm not mistaken, still open source and you can set-up your own repositories.
 

sherpa25

Senior Member
Jun 13, 2011
842
68
Muntinlupa
Wow, this is awesome! It must have been a LOT of work to get this working, let alone making it stable and usable, thank you! Android is really very usable without gapps now.
Also, here are a couple links to anyone interested in using it completely offline: https://f-droid.org/repository/browse/?fdfilter=Backend&fdid=org.fitchfamily.android.wifi_backend and https://f-droid.org/repository/browse/?fdfilter=Backend&fdid=org.fitchfamily.android.gsmlocation
The wifi backend even updates the local database with nearby APs once it has found a GPS fix, real neat!

---------- Post added at 12:50 AM ---------- Previous post was at 12:39 AM ----------



I use F-Droid and Aptoide. Aptoide really has a LOT of software, highly recommended. It is a fork of F-Droid if I'm not mistaken, still open source and you can set-up your own repositories.

Thanks, downloaded these 2 apps now. Still reading up on UnifiedNlp. Since nogapps is needed, will I still be accessing gmail and/or google account, w/c is asked by some apps? Sorry for some confusion. Thanks.
 

dp_alvarez

Member
May 5, 2014
30
16
I have a question: Is it possible to use UnifiedNlp with a offline copy of the OpenWlanMap database? In their website they provide the database for download, but I see no mention of using it with OpenWlanMapNlpBackend.
LocalWifiNlpBackend is intended to be used with our own database, but can I convert the OpenWlanMap database and use it?
 

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,269
Thanks, downloaded these 2 apps now. Still reading up on UnifiedNlp. Since nogapps is needed, will I still be accessing gmail and/or google account, w/c is asked by some apps? Sorry for some confusion. Thanks.
Currently it's not possible to use UnifiedNlp and apps requiring play services or Google apps.


I have a question: Is it possible to use UnifiedNlp with a offline copy of the OpenWlanMap database? In their website they provide the database for download, but I see no mention of using it with OpenWlanMapNlpBackend.
LocalWifiNlpBackend is intended to be used with our own database, but can I convert the OpenWlanMap database and use it?
This will be included in the next release.
 

daniel_m

Senior Member
Oct 7, 2012
668
289
Is it possible to disable Google location services with "My Android Tool" and use µg UnifiedNlp for location service but keep the Google services installed for other purposes (app licenses, ...)?
 

droika

Member
Nov 22, 2011
35
4
Exactly what I was looking for; don't want Google snooping around on my phone. Thanks a lot!

One thing though: I am running an unofficial CM11 on my Razr i. Installing your app via F-Droid or directly as an apk fails due to a wrong signature, i.e. UnifiedNlp seems to be installed already - I can't find it anywhere on my phone though...
 

steadyeddy

New member
Mar 16, 2014
4
4
[Offline OpenWLANMap location service] will be included in the next release.
Ooh I love you! That feature + a device patched to passively scan for Wifi APs = pinpoint the location without emitting any signals whatsoever even if GPS coverage is poor. That's some exquisite stuff, man.

By the way, does µg implement Google Cloud Messaging? It would be fantastic for RedPhone, to get secure(ish) voice comms to our poor iOS using friends.
 

sancho_panzer

Senior Member
Jul 11, 2014
721
828
I use F-Droid and Aptoide. Aptoide really has a LOT of software, highly recommended. It is a fork of F-Droid if I'm not mistaken, still open source and you can set-up your own repositories.
It's the opposite, F-Droid is a fork of Aptoide.

@MaR-V-iN it's possible to use lacells.db and cells.db both on µg UnifiedNlp and NetLocation just by changing their names. Are these databases compatible between them?


Device: Samsung Galaxy S4 (GT-I9505)
ROM: CyanogenMod 11/M12 (KK 4.4.4)
Kernel: Alucard-V1.4qs

Recovery: TWRP 2.8.3.0
Modem: I9505XXUGNE8

Device: Nexus 7 (Grouper)
ROM: CyanogenMod 11/M9 (KK 4.4.4)
Kernel: Default CM11/M9 3.1.10

Recovery: TWRP 2.7.1.0
 
Last edited:

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,269
MaR-V-iN it's possible to use lacells.db and cells.db both on µg UnifiedNlp and NetLocation just by changing their names. Are these databases compatible between them?

lacells.db is compatible with NOGAPPS NetworkLocation and the gsm backend for UnifiedNlp. cells.db is a different incompatible format. Renaming files will cause problems.
 
  • Like
Reactions: sancho_panzer

Top Liked Posts

  • There are no posts matching your filters.
  • 97
    Introduction
    UnifiedNlp is a FLOSS (Free/Libre Open Source Software) tool for geolocating android phones without Google's Geolocation service. It allows apps that use Android's coarse or network locating features to geolocate the phone which is usually faster and less battery consuming then GPS. If you use your phone without GAPPS this might become a useful tool for you.
    The real location work is done by backends (plug-ins) that can be configured through the UnifiedNlp UI. There is already a number of backends out there that use data from various data sources, some of them working completely offline.
    The same backend technique is used for UnifiedNlp's secondary feature: (reverse) geocoding. This allows apps like the android gallery to convert geo-coordinates to an address, resulting in better user experience.
    UnifiedNlp is the successor of NOGAPPS NetworkLocation and part of the microG Project.

    Installation
    UnifiedNlp comes with official support for Android 4.4 (KitKat) and Android 5.0 (Lollipop). Installation on AOSP-based ROMs for this version is easy:
    1. Make sure that no Google geolocation tool is installed (it is usually listed as Google Play Services in Apps)
    2. Download and install NetworkLocation.apk as a usual app (you may need to enable "Unknown sources" in Settings->Security)
    3. Reboot

    If your system is not AOSP-based but GAPPS-free and the above instructions do not work for you, try placing NetworkLocation.apk directly in /system/priv-app/ and reboot.

    If your system has Xposed, you can use this Xposed module together with UnifiedNlp.apk

    Android 2.3 (Gingerbread) through Android 4.3 (Jelly Bean) are not officially supported (meaning newer versions of UnifiedNlp are not tested on these platforms). Still a legacy version is published with every release. Android 4.2+ is known to usually work properly, older versions are often not supported by backends and thus can't use UnifiedNlp. Push LegacyNetworkLocation.apk directly to /system/app and reboot to try it out.

    Download
    Latest stable release: v1.4.0 - Download NetworkLocation.apk - LegacyNetworkLocation.apk - UnifiedNlp.apk
    Older versions and pre-release builds can be found on GitHub

    Backends
    I developed and will support three backends, that you can find on GitHub:AppleWifiNlpBackend, IchnaeaNlpBackend (Mozilla Location Service), OpenWlanMapNlpBackend and NominatimGeocoderBackend
    These and backends by other developers are usually released on F-Droid.
    If you installed a third-party backend and you're not sure whether the problem is caused by UnifiedNlp or the backend, feel free to write here.

    Upcoming/planned features
    - Better status information to check whether installation succeeded or not and what steps might be needed
    - Backend prioritization and complex rule system

    FAQ
    Q: It does not work!
    A: Make sure you read the installation instructions properly and that locating would be possible using the backends provided. Are you sure you rebooted? Is your system GAPPS free? OK. Now, ask!

    Thanks
    Big thanks to everyone who continuously supported me doing this, by donating, pull-requests or just feedback. Thanks to backend developers, that made this tool useful. Thanks to Google for leaving a door in Android that makes this possible.

    XDA:DevDB Information
    microG UnifiedNlp, App for all devices (see above for details)

    Contributors
    MaR-V-iN
    Source Code: https://github.com/microg/android_packages_apps_UnifiedNlp


    Version Information
    Status: Stable
    Current Stable Version: 1.4.0
    Stable Release Date: 2015-09-15

    Created 2015-01-02
    Last Updated 2015-10-04
    8
    I'm using LocalGsmNlpBackend and LocalWifiNlpBackend currently. For the Wifi, I have it at default settings. For GSM, I've used https://github.com/sobrus/FastLacellsGenerator to generate a 370MB+ lacells.db file (using OpenCelliD and Mozilla for sourcing, and for MMC's 310, 311, 312, 313, and 316 (all the United States according to Wikipedia)), pushed it over to /storage/emulated/0/LocalGSMBackend/lacells.db.new, and then set the External database location in settings to /storage/emulated/0/LocalGSMBackend which then causes lacells.db.new to be renamed to lacells.db. For Sources, I have the 2nd option chosen (download chosen areas from lacells), and "Nothing chosen (will use all)" for Areas (I'm assuming this doesn't matter and it'll just use all the data available in the lacells.db?)

    Is there anything else that should be done for this kind of set-up to be more optimal? Are both these backends ok to be using? Or should I perhaps switch over to another one like Mozilla? I'm looking for good accuracy primarily, and low battery usage, but I'm not entirely certain if using the backends locally would be better than using web-based ones like Mozilla's? On the other hand, I like the idea of my location data being primarily local. Also would either backend (Wifi and GPS) or UnifiedNlp itself need Doze/Battery Optimizations turned off at all? Right now I only have doze disabled for microG's Core Service.

    In the local GSM backend if you are building a lacells database offline, then the options for building a database on the phone are unused and it does not matter what you set them to. When the backend detects a lacells.db.new file, it closes its current lacells.db (if any), renames the current lacells.db to lacells.db.bak, renames lacells.db.new to lacells.db and then opens the new lacells.db file and starts using it for providing location. (FWIW, the on phone database generation does basically the same thing you did off line just slower. It uses the operator settings to determine the data source and the country (or mcc) settings to determine which towers to keep out of all the data it scans. Then it builds a database file and when complete renames it lacells.db.new and puts it into the same directory you put your lacells.db.new file. The actual location processing code then does exactly the same thing with the UI provided lacells.db.new file as it did with your offline produced one.)

    With respect to accuracy, many phones don't seem to support the calls for adjacent cells (older systems) or all cell data (newer phones) so the local GSM backend really has only the one tower you are connected to for determining location. So for many phones this will never be very accurate. It will get you into the town or part of city you are in but not much more.

    The local WiFi backend should have about the same accuracy as the Mozilla or Apple backends once it has learned the area. The "once it has learned the area" is the big caveat. For myself, the local WiFi backend knows my local neighborhood so when I get in the car and ask OsmAnd or Maps.me for a route to someplace I have the current location instantly. And the current location is kept accurate as I move out of my neighborhood long enough for the GPS to acquire and start providing accurate data. While in route, the local WiFi backend is learning the WiFi hotspots along the way and, more importantly, near the destination. When I am ready to leave that destination, the local WiFi backend will have learned that area well enough to give me an instant fix that OsmAnd or Maps.me can use when computing the route to my next destination.

    I wrote the two backends because I am cheap: I don't like paying for mobile plans with unlimited data. And even now that I've got a plan with data I usually have data disabled and rely on WiFi for Internet access. It is only when I am on a longer trip and won't be near a WiFi hotspot for several hours that I turn on data. Since I have data off the Mozilla and Apple backends are not useful for me. If you normally have data turned on, and don't mind the possibility that Mozilla and/or Apple might be gathering metadata on you, then you are probably better off using those backends. With respect to gathering metadata, you can look at the code for the Mozilla and Apple backends to see what is being sent to the server. In both cases it is very minimal and I personally would not worry about giving away too much metadata, especially if your mobile provider randomly changes your IP address from time to time.

    The SatStat app has a map function where you can see both the GPS and the network based locations. By enabling one location backend at a time you can get a feeling for the relative accuracy of the Mozilla, Apple, local WiFi and local GSM backends. My experience is that it depends on where you are as to whether the Apple or the Mozilla backend is more accurate. The accuracy of the local WiFi backend is pretty much up to how much data it has collected.

    With respect to battery usage: Neither the local GSM nor the local WiFi backends use any power unless you are running an app that is requesting location. It has been a while since I looked at the code for the other backends but I believe that they don't use any resources unless providing a location requested by some app. In my case, the apps that use location for longer than a quick fix (to get location for weather, etc.) are basically navigation apps and their use of GPS and having a powered on screen results in far more power use than the backends. I don't recall having ever seen a location backend show up in the battery stats and I don't have any power save feature enabled for them.
    8
    What other apps will be affected by disabling google play services? Want to try this but I have Play services installed.

    If you run with play services I guess you installed the complete GAPPS package, including Play Store etc. These either require Play Services or misbehave with Play Services removed or replaced.

    However, chances are good that there will be a complete Play Services replacement including UnifiedNlp sometime (sooner or later - no ETA here)
    6
    For what it is worth, I have just released "Déjá Vu", a new back end plug-in for microG/UnifiedNlp to GitHub.

    This new backend uses multiple RF types (mobile/cellular and WLAN/WiFi) to estimate the location of your phone. While the concept is similar to my previous wifi_backend, implementation details are different.

    For the last month or so, I've been using this new backend as a replacement for both my older Local-GSM-Backend and my older wifi_backend.

    I will continue to support the two older location backends when bugs are reported or if pull requests are received. However my personal focus is now on Déjá Vu and it is much more likely to get upgrades and improvements.
    4
    As I'm extremely happy with the preciseness of my network location, I'd simply like to share which backends I use (and as you see I don't use the Mozilla backend). For details please refer to the screenshots and feel free to reply in case of questions, comments or other recommendations.
    The last for screenshots have been taken from SatStat. For the first two, location mode was on energy saving (i.e. network/mobile data only), the last two with lacation mode in "high" (i.e. the former one plus GPS). For those who don't know SatStat, network location is indicated in blue, GPS location in red on the map. ...and in my personal opinion, the network location is really "acceptable".
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone