UnifiedNlp
Alternative network location provider for Android, with plugin interface to easily integrate third-party location providers.
Top Related Projects
Quick Overview
The microg/UnifiedNlp project is an open-source alternative to the proprietary Google Play Services, providing a framework for Android devices to access various Google services without the need for the official Google Play Services. It aims to provide a more privacy-focused and customizable solution for users who want to use Google services on their Android devices.
Pros
- Privacy-focused: The project aims to provide a more privacy-conscious alternative to the official Google Play Services, reducing the amount of data collected by Google.
- Customizable: Users can selectively enable or disable specific Google services, allowing for a more tailored experience.
- Open-source: The project is open-source, allowing for community contributions and transparency.
- Compatibility: The project aims to provide compatibility with a wide range of Android devices, including those that do not have official Google Play Services support.
Cons
- Limited functionality: While the project aims to provide a comprehensive alternative to Google Play Services, it may not have the same level of functionality or feature parity as the official solution.
- Potential compatibility issues: The project may not be compatible with all Android devices or applications that rely on the official Google Play Services.
- Ongoing maintenance: As an open-source project, the microg/UnifiedNlp project relies on the continued efforts of the community to maintain and improve the software.
- Legal concerns: The use of the project may raise legal concerns, as it involves the use of Google's proprietary services without their official approval.
Code Examples
N/A (This is not a code library)
Getting Started
N/A (This is not a code library)
Competitor Comparisons
The main repository of the Open GApps Project
Pros of OpenGApps
- Provides a complete Google Apps package for Android devices
- Offers various package sizes to suit different needs and device capabilities
- Regularly updated to include the latest versions of Google apps
Cons of OpenGApps
- Larger file size and installation footprint compared to UnifiedNlp
- Requires more system resources and may impact device performance
- Less privacy-focused, as it includes full Google services
Code Comparison
UnifiedNlp (simplified location provider):
public class SimplifiedLocationProvider extends LocationProvider {
@Override
public Location getLastLocation() {
// Simplified location retrieval logic
}
}
OpenGApps (GmsCore location service):
public class GmsLocationProvider extends LocationProviderBase {
@Override
public void onGetLastLocation(GetLastLocationRequest request) {
// Complex Google location services implementation
}
}
UnifiedNlp focuses on a minimalistic approach to location services, while OpenGApps implements the full Google location stack, resulting in more complex code but potentially more accurate results.
Free implementation of Play Services
Pros of GmsCore
- More comprehensive replacement for Google Play Services
- Supports a wider range of Google APIs and services
- Actively maintained with frequent updates
Cons of GmsCore
- Larger codebase and more complex to implement
- May require more system resources
- Potential compatibility issues with some apps
Code Comparison
GmsCore (Java):
public class GmsCore extends Application {
@Override
public void onCreate() {
super.onCreate();
// Initialize GmsCore components
}
}
UnifiedNlp (Java):
public class UnifiedNlp extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// Handle location requests
return START_STICKY;
}
}
Key Differences
- UnifiedNlp focuses specifically on network-based location services
- GmsCore provides a broader range of Google Play Services functionality
- UnifiedNlp is generally lighter and easier to implement for location-specific needs
- GmsCore offers more features but may have a larger impact on system performance
Use Cases
- UnifiedNlp: Ideal for projects requiring only network-based location services
- GmsCore: Better suited for apps needing comprehensive Google Play Services replacement
Both projects aim to provide open-source alternatives to Google's proprietary services, with UnifiedNlp offering a more targeted solution and GmsCore providing a more complete replacement for Google Play Services.
Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system
Pros of Anbox
- Provides a full Android runtime environment on Linux systems
- Allows running Android apps natively on Linux without emulation
- Supports a wider range of Android applications and features
Cons of Anbox
- Requires more system resources due to running a full Android container
- More complex setup and configuration process
- May have compatibility issues with some Linux distributions
Code Comparison
UnifiedNlp (Java):
public class UnifiedNlp extends Service {
@Override
public void onCreate() {
super.onCreate();
// Initialize location providers
}
}
Anbox (C++):
class AndroidRuntime {
public:
AndroidRuntime();
bool init();
void run();
private:
// Android runtime implementation
};
UnifiedNlp focuses on providing a unified network location provider for Android, while Anbox aims to create a complete Android runtime environment on Linux. UnifiedNlp is primarily written in Java and integrates with Android's location services. Anbox, on the other hand, is written in C++ and implements a more comprehensive Android runtime, allowing for broader application support but requiring more system resources and setup complexity.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Unified Network Location Provider
The next generation Network Location Provider, based on plugins. Usually abbreviated as UnifiedNlp.
Installation
Release builds may be found on the release page.
Unified Network Location Provider is provided in 3 variants:
- NetworkLocation.apk â for the usual configuration of Android 4.4+ without GApps
- LegacyNetworkLocation.apk â for the usual configuration of Android 2.3 - 4.3.1 without GApps
- UnifiedNlp.apk â for Android WITH Gapps
Keep in mind that:
- All three variants are available on F-Droid as well, but they use different apk names (have a look at app description on F-Droid to check which version to use).
- There is another repo containing the deprecated version of NetworkLocation.apk without the plug-in system.
- microG GmsCore project already includes the Unified Network Location Provider.
Android 4.4 - 7.1.1 (KitKat / Lollipop / Marshmallow / Nougat)
Most modern ROMs come with support for non-Google geolocation providers. On these systems installation is easy:
- Make sure that no Google geolocation tool is installed (it is usually listed as Google Play Services in Apps)
- Download and install
NetworkLocation.apk
as a usual app (you may need to enable "Unknown sources" in Settings->Security) - Reboot and continue at Usage
Some ROMs, especially those not based on AOSP might have problems using this method. However, if your system has root, you can try installing the hard way:
- Download
NetworkLocation.apk
- Mount
/system
read-write (from your PC, calladb root && adb remount
) - Copy
NetworkLocation.apk
to/system/priv-app
(from your PC, calladb push NetworkLocation.apk /system/priv-app/NetworkLocation.apk
) - Reboot (from you PC, call
adb reboot
) and continue at Usage
Note: On Android 7 (or later) an additional patch is needed to make it working, or alternatively, you can install it in /system/priv-app
as explained above.
Android 2.3 - 4.3.1 (Gingerbread / Honeycomb / Ice Cream Sandwich / Jelly Bean)
Older Android versions are no longer officially supported. However I still provide a legacy build, that should be compatible with those systems. It is required to have a rooted system to install on Jelly Bean and older.
- Download
LegacyNetworkLocation.apk
- Mount
/system
read-write (from your PC, calladb root && adb remount
) - Copy
LegacyNetworkLocation.apk
to/system/app
(from your PC, calladb push LegacyNetworkLocation.apk /system/app/LegacyNetworkLocation.apk
) - Reboot (from you PC, call
adb reboot
) and continue at Usage
Usage
UnifiedNlp alone does not provide any features, but acts as a middleware for multiple backends. Most of them can be downloaded and updated using F-Droid. Here is a list of backends known to me.
List of backends for geolocation:
- AppleWifiNlpBackend - Uses Apple's service to resolve Wi-Fi locations. It has excellent coverage but the database is proprietary.
- OpenWlanMapNlpBackend - Uses OpenWlanMap.org to resolve user location but the NLP backend did not reach release-quality, yet. Users interested in a freely licensed and downloadable database for offline use should stick with openBmap for now - Last updated in 2015
- OpenBmapNlpBackend - Uses openBmap to resolve user location. Community-created, freely licensed database that can optionally be downloaded for offline operation. The coverage varies from country to country (it's best in central Europe).
- MozillaNlpBackend - Uses the Mozilla Location Service to resolve user location. The coverage is OK. Only the cell tower database is free.
- LocalWifiNlpBackend - Local location provider for Wi-Fi APs using on-phone generated database.
- LocalGSMLocationProvider - Local opencellid based location provider backend. Has been surpassed by LocalGSMBackend which also has an OpenCellID option - Last update in 2014
- LocalGSMBackend - Local location provider for GSM cells. It works offline by downloading freely licensed database files from Mozilla, OpenCellID, or lacells.db.
List of backends for (reverse) geocoding:
- NominatimGeocoderBackend - Address lookup backend.
(...) Create issue or pull request to extend either list :)
After installing a backend, you can use UnifiedNlp by activating network-based geolocation in Settings->Location. Since KitKat, you need to select any mode but "device only", on older Android version this setting is called "Wi-Fi & mobile network location" (ignore any misleading texts saying this is for Google's location service, you don't have Google's service installed but UnifiedNlp :smile:)
Backend development
The API is available here. Documentation may be found in the README provided with the API.
You might also take a look into existing backends, to see how they work out.
Building
UnifiedNlp can be easily built using Gradle.
git clone https://github.com/microg/UnifiedNlp
cd UnifiedNlp
./gradlew build
Attribution
Some components: Copyright (C) 2013 The Android Open Source Project
compat
-folder is extracted from different AOSP versions for cross-version compatibility
License
Copyright (C) 2013-2022 microG Project Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Top Related Projects
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot