簡體   English   中英

Android應用程序類別通過Play商店

[英]Android App Category via Play Store

我想建立一個安裝在我的Android設備上的應用程序列表。 我也想在我的列表中保存我的應用程序的使用類別。

所以舉個例子。 我可以看到我有多少“游戲”應用程序等。

我已經有一個安裝在我的設備中的Android應用程序列表,現在我需要這些類別。

我的第一個方法是使用appaware.com,但我的目標是使用官方的游戲商店。

你有任何想法,我可以在掃描網站旁邊使用它。 您是否知道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 :-)

謝謝你的回答。

我也遇到了同樣的問題。 上述查詢的解決方案如下所述。

首先,下載Jsoup庫或下載jar文件。

或者將它添加到你的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());
    }
 }
}

作為回報,您將獲得應用程序公司名稱和應用程序的類別

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM