[英]Why can't I get a list of installed apps for Android in Flutter?
I have been trying out 2 libraries in order to get a list of all the installed apps for Android.我一直在尝试 2 个库,以获取 Android 的所有已安装应用程序的列表。 The libraries that I use are made for the Flutter framework.我使用的库是为 Flutter 框架制作的。 When I try to get a list of installed apps, I noticed that only the app that I am working on is being shown in this list and not all the installed apps.当我尝试获取已安装应用程序的列表时,我注意到只有我正在处理的应用程序显示在此列表中,而不是所有已安装的应用程序。 How am I able to override this limitation?我怎样才能超越这个限制? Is there anyone who experienced the same problem?有没有人遇到过同样的问题?
These are the libraries that I have tried:这些是我尝试过的库:
A swift help is much appreciated!非常感谢 swift 帮助!
<manifest...> <清单...>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
add this permission to query the packages添加此权限以查询包
By using the package https://pub.dev/packages/device_apps you can get list of packages /apps in the device通过使用 package https://pub.dev/packages/device_apps您可以获得设备中的包/应用程序列表
And you can get list of packages with:您可以通过以下方式获取软件包列表:
List apps = await DeviceApps.getInstalledApplications();列出应用程序 = 等待 DeviceApps.getInstalledApplications();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.