我在一个应用程序中工作,我正在使用此代码获取安装在我设备上的所有应用程序:
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory("com.myapp.MY_CATEGORY");
final List<ResolveInfo> pkgAppsList =getPackageManager().queryIntentActivities( mainIntent, 0);
现在我想对应用进行不同的分类根据它们的类别。请建议我。
最佳答案
要了解应用程序的类别,您需要从 google play 获取数据。你可以查看android-market-api .它是第三方 api。根据他们的信息
- You can browse market with any carrier or locale you want.
- Search for apps using keywords or package name.
- Retrieve an app info using an app ID.
- Retrieve comments using an app ID.
- Get PNG screenshots and icon
所以你最好检查一下你是否可以使用这个 api 解析类别信息。
关于android - 在 Android 中以编程方式获取任何应用程序的类别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16736282/