0

This question has been asked before: How to get list of ALL apps (including System Apps)?

However, when I called getPackageManager().getInstalledPackages(0), it did not return all the apps. For example, the following apps were not found by this call: com.google.android.music, com.google.android.youtube, com.google.earth, com.google.android.gm.

Is it because they are part of Google Mobile Service?

Community
  • 1
  • 1
JustWonder
  • 2,373
  • 3
  • 25
  • 36

1 Answers1

1

Code:

public static List<ApplicationInfo> getInstalledAppInfos(Context context) {
    final PackageManager packageManager = context.getPackageManager();
    return packageManager.getInstalledApplications(PackageManager.GET_META_DATA);
}

Test:

List<ApplicationInfo> apps = getInstalledAppInfos(this);
for (int i = 0; i < apps.size(); i++) {
         Log.d(TAG, "App( " + i + ") " + apps.get(i).packageName);
}
Martin Pfeffer
  • 12,471
  • 9
  • 59
  • 68