[Nexus 5 Android Development] androcraze:
Using UnifiedNlp(GAPPS) with AlmostVanillaAOSP:

What is UnifiedNlp(GAPPS)?

The UnifiedNlp(GAPPS) tool (application) works WITH an installed version of Google's GApps to enhance Location capabilities on AOSP ROMs; the XDA thread for this tool can be found HERE.

Why do we need UnifiedNlp(GAPPS)?

Developer MaR-V-iN provides a detailed response in his initial reply to this GITHUB POST. The short version is:

Google started with an open Location API that was used for AOSP and Google's factory ROMs.

Google created a new Play Services Location API that isn't included in AOSP code and it's only included in factory ROMs.

Google recommends that developers use the newer, closed API version.

Despite the fact that there are few differences between the old and new APIs, some developers are migrating solely to the new API, stranding AOSP users.

Simply put, a growing list of applications (Chronus, f.lux, Google Fit, etc.) refuse to work with the older Open Location API; UnifiedNlp(GAPPS) adds functionality to get these unusable apps working on AOSP ROMs.

How does AlmostVanillaAOSP support UnifiedNlp(GAPPS)?

AlmostVanillaAOSP now includes a build patch (found in Post #1, under "Sources and Source Patches") that adds "org.microg.nlp" to the Location Services providers. It's a simple two-line addition (including one line for a comment). AlmostVanillaAOSP DOES NOT install the UnifiedNlp app; that's up to the user to decide if it's needed or wanted. A user opting to NOT install the UnifiedNlp app will see no performance or functional changes.

Notes

There is a UnifiedNlp(

no

GApps) version available. It's designed to work with the MicroG Services (an open substitute for Google Play Services). The directions in this post DO NOT apply to the "noGAPPS" version of this application.

Xposed: AlmostVanillaAOSP versions 20170418 and later have support for UnifiedNlp "compiled-in". There should be no need to install the UnifiedNlp Xposed module to get the app/tool to run.

The UnifiedNlp(GAPPS) tool must reside in /system, not in /data; the flashable zip will make installation much easier.

When installed properly, the UnifiedNlp(GAPPS) tool WILL NOT display under the Launcher Apps Menu; you'll find the tool listed under Settings -> Location.

Setup

1. Install AlmostVanillaAOSP[6.0.1_r79-MOB31T]-20170418, or a later ROM revision.

- Follow the suggested install process listed under "Installation" in Post #1.

2. Flash the the UnifiedNlp(GAPPS) app/tool.

- Found in Post #1, under "Add-on Downloads"

- This flashable version of UnifiedNlp is designed to work WITH GApps

3. Install your choice of UnifiedNlp "backend" APKs.

- See the "Backends" list below.

- Should be "side-loaded" via ABD or installed via file manager.

- You can install as many backends as you desire, but you should only have one active.

- The Apple, Mozilla, and OpenBMap backends are "interesting" for our purposes WITH GApps, and should be prioritized.

4. Go to System Settings --> Location:

- Ensure "Mode" is set to either "High accuracy" or "Battery saving", NOT "Device only".

- Ensure that "UnifiedNlp Settings" is listed under "Location services"

5. In System Settings --> Location --> Location services --> UnifiedNlp Settings:

- Enter "Configure location backends", add and configure desired backends.

- Return to "UnifiedNlp Settings".

- Enter "Self-Check", ensuring that all boxes are checked.

Backends

Again, the Apple, Mozilla, and OpenBMap location backends are probably best for easiest compatibility WITH GApps.

Location Backends:

Apple UnifiedNlp Backend - UnifiedNlp location provider (Apple WiFi) - F-Droid

UnifiedNlp backend that uses Apple's service to resolve wifi locations

MozillaNlpBackend - UnifiedNlp location provider (Mozilla) - F-Droid

UnifiedNlp backend that uses Mozilla Location Services to resolve locations (AKA IchnaeaNlpBackend).

OpenBmapNlpBackend - UnifiedNlp location provider (Openbmap) - F-Droid

UnifiedNlp (no GAPPS) backend that uses OpenBmap.

Address Lookup Backends:

NominatimNlpBackend - UnifiedNlp geocoding provider (MapQuest Nominatim) - F-Droid

UnifiedNlp (no GAPPS) backend that uses MapQuest's Nominatim service (based on OpenStreetMap) for geocoding.

Database Location Backends:

LocalGsmNlpBackend - UnifiedNlp location provider (local GSM database) - F-Droid

UnifiedNlp (no GAPPS) backend that uses local GSM data to resolve user location. Create a database using data from OpenCellId and/or Mozilla Location Services CSV files.

LocalWifiNlpBackend - UnifiedNlp location provider (local WiFi database) - F-Droid

UnifiedNlp (no GAPPS) backend that uses locally acquired WiFi AP data to resolve user location. 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.