How do I get list of android apps ID which were installed on smartphone?. All android application will have its unique ID. Is it possible to retrieve ID?
Asked
Active
Viewed 82 times
0
-
package name is the android unique id – Michael A Nov 23 '16 at 15:29
-
1Possible duplicate of http://stackoverflow.com/q/2695746/3144836 – user3144836 Nov 23 '16 at 15:34
-
Possible duplicate of [How to get Android application id?](http://stackoverflow.com/questions/1264397/how-to-get-android-application-id) – Vasil Dininski Nov 23 '16 at 15:41
1 Answers
0
Android unique app id is its package name
You can get the user installed apps like this:
List<PackageInfo> packList = getPackageManager().getInstalledPackages(0);
for (int i=0; i < packList.size(); i++)
{
PackageInfo packInfo = packList.get(i);
if ( (packInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0)
{
String appName = packInfo.applicationInfo.loadLabel(getPackageManager()).toString();
Log.e("App № " + Integer.toString(i), appName);
}
}
Or all the apps (including the system apps):
List<PackageInfo> packList = getPackageManager().getInstalledPackages(0);
for (int i=0; i < packList.size(); i++)
{
PackageInfo packInfo = packList.get(i);
String appName = packInfo.applicationInfo.loadLabel(getPackageManager()).toString();
Log.e("App № " + Integer.toString(i), appName);
}

Michael A
- 5,770
- 16
- 75
- 127