If you the ApplicationInfo
of a installed app, is there a way you can find out what its market category is?
3 Answers
The ApplicationInfo will only provided information related to the apps manifest (packagename,appname,icon,.....). You won't be able to retrieve Market data for that app.
Market specific items like price,market category,feature graphic cannot be retrieved using the Android SDK.
There are "unofficial" third party APIs available to do this. ex: http://code.google.com/p/android-market-api/

- 22,363
- 10
- 69
- 82
-
I've seen a couple of apps that list your apps in market categories. Does that mean they search for each of your apps in the market and create categories like that? – aph May 30 '11 at 12:21
-
1Something like that. There are APIs available for this (see updated answer). Most of them will rely on parsing the HTML responses from the Android web-based Market. – ddewaele May 30 '11 at 12:28
If you just want a dirty way, here is my php code:
<?
$package_name = "com.devbro.appdrawer";
$content = file_get_contents('https://play.google.com/stor/apps/details?id='.$package_name);
preg_match_all("|/store/apps/category/(.*)\?feature=category-nav|U",$content,$out,PREG_PATTERN_ORDER);
echo $out[1][0];

- 301
- 1
- 8
The ApplicationInfo only returns information collected from the AndroidManifest.xml's <application>
tag.
What you are trying to access is Google Play Store specific information, something the developer specifies once publishing an app from his/her developer's account dashboard. Please also note the "category" can be changed anytime later...
To get the category of an app you need to get that data from Google Play itself. For instance, you could develop your own HTML crawler, parse the page and extract the app "category". This topic has been covered in other questions, for example here.
If you don't want to implement all that by yourself, you could use a third-party service to access Android apps meta-data through a JSON-based API.
For instance, 42matters.com (the company I work for) offers a unified API for both Android and iOS, here more details:
https://42matters.com/app-market-data
With the "lookup" endpoint you could ask for a specific Android app meta-data by specifying it's "package name" (i.e. its identifier). In the JSON response it will be returned the "category" as you find on Google Play.
I hope this helps :)

- 2,895
- 22
- 22