Reputation: 2433
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?
Upvotes: 0
Views: 288
Reputation: 12627
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);
}
Upvotes: 1