然后,在Activity中获取应用程序列表,并将其显示在列表视图中: ListViewappListView=findViewById(R.id.app_list);PackageManagerpackageManager=getPackageManager();List<ApplicationInfo>appList=packageManager.getInstalledApplications(0);List<String>appNames=newArrayList<>();for(ApplicationInfoappInfo:appList){Stringa...
使用Android手机的浏览器打开:http://192.168.1.96:8888, 点"FiddlerRoot certificate" 然后安装证书,如图: 到这里我们就设置好所有的值,下面就来测试一下,打开手机的超级课程表APP 这样就抓取Android移动端的数据包成功了,这个对于我们后面进行网络数据请求的调试有很大的帮助,我们可以通过这个方法来判断我们请求网络是...
private void getAppList() { PackageManager pm = getPackageManager(); // Return a List of all packages that are installed on the device. List<PackageInfo> packages = pm.getInstalledPackages(0); for (PackageInfo packageInfo : packages) { // 判断系统/非系统应用 if ((packageInfo.applicationInf...
List<String>installedPackages=getInstalledPackages(this);printPackages(installedPackages,"installed");List<String>launcherIconPackages=getAllLauncherIconPackages(this);printPackages(launcherIconPackages,"launcherIcon"); 则会得到如下输出: 14:40:19.096 9446 9446 AppListActivity: installed packageSize=455 14:40...
Android 11 获取app列表发现,只能获取系统安装的类别,其他新装的无法获取到,原因在于权限不够 代码如下 ``` List<PackageInfo> packages = context.getPackageManager().getInstalledPackages(PackageManager.GET_ACTIVITIES | PackageManager.GET_SERVICES); for (int i = 0; i < packages.size(); i++) { ...
//获取app信息 public void getAppProcessName(Context context) { final PackageManager packageManager = getPackageManager(); final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); final List<ResolveInfo> apps = packageManager.queryIntentActivitie...
public MyAdapter(Context context, List<? extends Map<String, ?>> data, int resource, String[] from, int[] to) { super(context, data, resource, from, to); appData = data; appResource = resource; appFrom = from; appTo = to; appInflater = (LayoutInflater)context.getSystem...
AppInfo myAppInfo;//获取到所有安装了的应用程序的信息,包括那些卸载了的,但没有清除数据的应用程序 List<PackageInfo> packageInfos = packageManager.getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES);for(PackageInfo info:packageInfos){myAppInfo = new AppInfo();//拿到包名...
你可以通过调用getpackagemanager()得到PackageManager类的一个实例。对查询和操作安装包和相关的权限提供了方法,在下面这个Android的例子中,我们得到了在Android安装的应用程序列表。 PackageManager packageManager = getPackageManager(); List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager....
layout.activity_main); getAllAppNames(); } public void getAllAppNames(){ PackageManager pm=getPackageManager(); ///获取到所有安装了的应用程序的信息,包括那些卸载了的,但没有清除数据的应用程序 List<PackageInfo> list2=pm.getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES); int j=0; for...