简体   繁体   English

Android应用程序类别通过Play商店

[英]Android App Category via Play Store

I want to build a list of my apps which are installed on my android device. 我想建立一个安装在我的Android设备上的应用程序列表。 And i want to save the used categories of my apps in my list, too. 我也想在我的列表中保存我的应用程序的使用类别。

So for example. 所以举个例子。 i can see how much "Games" apps i have etc. 我可以看到我有多少“游戏”应用程序等。

I already have a list of the android apps installed in my device, and now i need the categories. 我已经有一个安装在我的设备中的Android应用程序列表,现在我需要这些类别。

My first approach was to use appaware.com but my goal is to use the official play-store. 我的第一个方法是使用appaware.com,但我的目标是使用官方的游戏商店。

Do you have any ideas how i can use that beside scanning the website. 你有任何想法,我可以在扫描网站旁边使用它。 Do you know any unofficial APIs in Java or JavaScript or are the any hidden official APIs for that? 您是否知道Java或JavaScript中的任何非官方API,或者是任何隐藏的官方API?

so what i have: - a list of all my apps (incl. package etc.)
what i need: an API to get the categories of the apps :-)

thanks for your answers. 谢谢你的回答。

I also faced the same issue. 我也遇到了同样的问题。 The solution for the above query is stated below. 上述查询的解决方案如下所述。

Firstly, download the Jsoup library or download the jar file. 首先,下载Jsoup库或下载jar文件。

or Add this to your build.gradle(Module: app) implementation 'org.jsoup:jsoup:1.11.3' 或者将它添加到你的build.gradle(Module:app)实现'org.jsoup:jsoup:1.11.3'

private class FetchCategoryTask extends AsyncTask<Void, Void, Void> {

private final String TAG = FetchCategoryTask.class.getSimpleName();
private PackageManager pm;
//private ActivityUtil mActivityUtil;

@Override
protected Void doInBackground(Void... errors) {
    String category;
    pm = getPackageManager();
    List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
    Iterator<ApplicationInfo> iterator = packages.iterator();
    //  while (iterator.hasNext()) {
    // ApplicationInfo packageInfo = iterator.next();
    String query_url = "https://play.google.com/store/apps/details?id=com.imo.android.imoim";  //GOOGLE_URL + packageInfo.packageName;
    Log.i(TAG, query_url);
    category = getCategory(query_url);
    Log.e("CATEGORY", category);

    // store category or do something else
    //}
    return null;
}


private String getCategory(String query_url) {

    try {
         Document doc = Jsoup.connect(query_url).get();
        Elements link = doc.select("a[class=\"hrTbp R8zArc\"]");
           return link.text();
    } catch (Exception e) {
        Log.e("DOc", e.toString());
    }
 }
}

In return, you will get Application Company Name and category of the application 作为回报,您将获得应用程序公司名称和应用程序的类别

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过Android中的包名从Play商店获取应用类别? - How to get an App category from play store by its package name in Android? Android 应用程序在 Play 商店发布后崩溃? - Android app crashes after publishing on Play Store? Android无法在Play商店上找到名称为的应用 - android unable to find app on play store with name 从PreferenceActivity启动android Play商店应用吗? - Launch android Play Store app from PreferenceActivity? Branch io - 通过 Play 商店安装应用后没有参考参数 - Branch io - No referringParams after app is installed via play store 通过 Play 商店在 Android 应用程序中唯一标识用户? - Uniquely identifying the user in the Android application via the Play store? 与我的应用分享Android Play商店应用链接 - Share Android Play Store app link with my app Android应用问题-如何在Play商店中加载应用条目 - Android app issue - how to load app entry in play store 我们可以在 Play 商店中将 Android 应用程序更新为 Flutter 应用程序吗 - Can we update Android app to Flutter app on Play Store Facebook Android应用程序链接打开Facebook页面而不是Play商店 - Facebook Android app link opens Facebook page instead of Play Store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM