Reputation: 18766
Several games and apps show adds like install the app to get rewards. How does that function? Can I get the list of all the apps that user has installed on his device including uninstalled apps, how?
Upvotes: 1
Views: 78
Reputation: 791
You can get list of installed non-system apps
public void installedApps() {
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);
}
}
}
Upvotes: 1