如何获取已下载的应用程序列表 我的意思是已经下载并安装了超市和程序或站点。
答案 0 :(得分:0)
我认为你的意思是设备上安装/下载的所有应用程序,如果不是这样,请评论我。
使用包管理器如下:
final PackageManager pm = getPackageManager();
//List of installed app assigned to 'packages'
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
//iterate through all the installed packages
for (ApplicationInfo packageInfo : packages) {
Log.d(TAG, "Installed package :" + packageInfo.packageName);
Log.d(TAG, "Source directory : " + packageInfo.sourceDir);
Log.d(TAG, "Launch Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName));
}