[英]Retrieve and Display Installed Android Apps
I want to create an android code that can retrieve all installed apps in my device and display them with icons in a good format.我想创建一个 android 代码,它可以检索我设备中所有已安装的应用程序,并以良好的格式用图标显示它们。 How do I display the list of apps installed in the system with a good layout?如何以良好的布局显示系统中安装的应用程序列表?
You might need to learn about ListView
: http://developer.android.com/guide/topics/ui/layout/listview.html您可能需要了解ListView
: http : //developer.android.com/guide/topics/ui/layout/listview.html
To get a list of all installed apps, you can follow this link: How to get a list of installed android applications and pick one to run要获取所有已安装应用程序的列表,您可以点击此链接: 如何获取已安装的 android 应用程序列表并选择一个运行
Try putting the list of all apps in your ListView
尝试将所有应用程序的列表放在您的ListView
To get app icon, after you get the list of all apps, you will also get their package names - follow this link: How can I get the application's icon from the package name?要获取应用程序图标,在获得所有应用程序的列表后,您还将获得它们的包名称 - 按照此链接: 如何从包名称中获取应用程序的图标?
Use PackageManager
to get all details of installed packages
使用PackageManager
获取已安装packages
所有详细信息
PackageManager packageManager = getPackageManager();
List apps = packageManager.getInstalledApplications(PackageManager.GET_META_DATA);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.