Reputation: 2694
Twitter is all over the news about wanting to collect a list of all apps installed on users iOS and Android.
Is there any recent API I'm no aware off that allows them to do that? or are they scanning app url schemes registered?
Upvotes: 1
Views: 406
Reputation: 9477
If you want to get the list of installed apps in android you can use this:
/**
* Returns a list of installed apps
*/
public static ArrayList<PackageInformation> getInstalledApps(
Context contxt, boolean getSysPackages) {
ArrayList<PackageInformation> pacakgeInformationList = new ArrayList<PackageInformation>();
List<PackageInfo> packs = contxt.getPackageManager()
.getInstalledPackages(0);
for (int i = 0; i < packs.size(); i++) {
PackageInfo packageInfo = packs.get(i);
if ((!getSysPackages)) {
continue;
}
PackageInformation newInfo = new PackageInformation();
newInfo.setAppName(packageInfo.applicationInfo.loadLabel(
contxt.getPackageManager()).toString());
newInfo.setPacakgeName(packageInfo.packageName);
newInfo.setVersionName(packageInfo.versionName);
newInfo.setVersionCode(packageInfo.versionCode);
newInfo.setIcon(packageInfo.applicationInfo.loadIcon(contxt
.getPackageManager()));
pacakgeInformationList.add(newInfo);
}
return pacakgeInformationList;
}
and after that you just need permission to access to the internet and then easily send what information you want to what server you want.
So unfotunatley YES, it's possible to do that in android.
And for ios please see this post: Get list of all installed apps
They said without jailbroken iPhones you can not do this.
Upvotes: 1
Reputation: 687
Piece of code will bring you all the list of activities/applications installed on Android :
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
for more information, take a look: How to get a list of installed android applications and pick one to run
Upvotes: 1