2

I am using the Market API, I know it is unofficial, but I want to get the categories of all apps in my device, and it's the only way.

This is my code:

String query = "com.android.example";

MarketSession session = new MarketSession();
session.login("example@gmail.com", "password");
AppsRequest appsRequest = AppsRequest.newBuilder().setQuery(query)
            .setStartIndex(startIndex).setEntriesCount(10)
            .setWithExtendedInfo(true).build();
session.append(appsRequest, new Callback<Market.AppsResponse>() {

        @Override
        public void onResult(ResponseContext arg0, AppsResponse arg1) {
            for (com.gc.android.market.api.model.Market.App app : arg1
                    .getAppList()) {
                if (app.getExtendedInfo().getPackageName().equals(query)) {
                    Log.d(TAG, "category: "
                            + app.getExtendedInfo().getCategory());

                }
            }               
        }
    });
    session.flush();

I went through all the package names of all the apps on my device, but only some of them returned a category.

I believe there is a problem here.

Does anyone know anything about this?

Robin Giltner
  • 3,057
  • 2
  • 18
  • 26
offset
  • 1,407
  • 1
  • 16
  • 34

0 Answers0