I want to do an intent filter with all gps apps installed in device.
I found this, but now, how I get the gps apps installed in device?
Anyone knows?
Thank you!
A crude, but the only, way would be to scan all the packages for apps that request the ACCESS_FINE_LOCATION
permission.
This will give you a list of the apps that can use the GPS. It doesn't guarantee that they do use the GPS.
PackageManager p = context.getPackageManager();
final List<PackageInfo> apps = p.getInstalledPackages(PackageManager.GET_PERMISSIONS);
for (PackageInfo pkg : apps) {
for (String permission : pkg.requestedPermissions) {
// Check if permission is the ACCURACY FINE permission
}
}