How can I get the list of installed third-party applications on Android phone.
I am able to get the list of application with the code below but I want only third-party applications.
PackageManager pm = context.getPackageManager();
appInstalModel.setAppName(p.applicationInfo.loadLabel(context.getPackageManager()).toString());
appInstalModel.setAppPkg(p.packageName);
appInstalModel.setAppVersionName(p.versionName);
Third-party apps and services are created by companies or developers that aren't Google. For example, you may download an app that helps you schedule workouts with friends. This app may request access to your Google Calendar and Contacts to suggest times and friends for you to meet up with.
Go to Settings. Tap Apps & notifications, and then tap See all... to view the app list. Look for any suspicious or unfamiliar apps, and then tap Uninstall or Disable.
Android is, for the most part, an open platform. You can use the Google Play Store to install apps and games or you can go off the reservation and install APKs on your own. It's not a practice we recommend.
First-party applications are those controlled by the same organization or person who owns the Auth0 domain. For example, let's say you created both a Contoso API and an application that logs into contoso.com and consumes the Contoso API.
List<ApplicationInfo> apps = getPackageManager().getInstalledApplications(0);
for (int i=0; i < apps.size(); i++)
{
if ((apps.get(i).flags & ApplicationInfo.FLAG_SYSTEM) == 1)
{
//System app
}
}
RoflcoptrException's answer is correct. But in some cases it won't give you all the installed third-party applications. ApplicationInfo
also has flag FLAG_UPDATED_SYSTEM_APP
which is set
If this application has been install as an update to a built-in system application
On my smart phone such applications include Amazone Kindle, Adobe Reader, Slacker Radio and others. These applications did not come with the phone and were installed from Google Play Store. Thus, they can be considered as third-party apps.
So, you may also want to check FLAG_UPDATED_SYSTEM_APP
flag.
final PackageManager packageManager = _context.getPackageManager();
List<ApplicationInfo> installedApplications =
packageManager.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo appInfo : installedApplications)
{
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)
{
// IS A SYSTEM APP
}
if ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0)
{
// APP WAS INSTALL AS AN UPDATE TO A BUILD-IN SYSTEM APP
}
}
The ApplicationInfo object will have the FLAG_SYSTEM
flag unset. The sdmove program might have some sample code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With