Reputation: 30804
I use this URI
to search the Play Store, but the Android docs don't mention a way to search a specific category like, games, music, or books.
URI marketUri = Uri.parse("market://search?q= ");
The Play Books and Play Music apps both open the Play Store app to their correct categories, so if they can open to a specific catergory, then I think I can search one. Does anyone have some info on doing this?
Upvotes: 4
Views: 2547
Reputation: 30804
I found the solution. Here's the current method I'm using to shop the music category.
public static void shopFor(Context context, String artistName) {
String str = "https://market.android.com/search?q=%s&c=music&featured=MUSIC_STORE_SEARCH";
Intent shopIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(str, Uri.encode(artistName))));
shopIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shopIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(shopIntent);
}
Upvotes: 6
Reputation: 2132
I did a search at play.google.com in the books category and the URL looks like this:
https://play.google.com/store/search?q=android&c=books
try adding "&c=books" after your query and see what happens.
Upvotes: 1