Rafael Ruiz Muñoz
Rafael Ruiz Muñoz

Reputation: 5472

Check if Android app is a game by packageName

This is a question that I've not been able to fetch from StackOverflow or directly from Google. Is it maybe because I didn't search with the right words?

Well, anyway:

I'm trying to check if an app is a game by its packageName.

What I've researched:

  1. I know the app could be checked if it comes from the Play Store, but what about if it comes from any store?
  2. Inside the PackageInfo, there's the feature PackageManager.FEATURE_GAMEPAD but what about if it doesn't have any GAMEPAD or anything related? just a game of... puzzle for example?.
  3. I know that from API >= 21 you can really check it, but what about the older ones?

Thank you very much in advance.

Regards.

Rafael.

Upvotes: 0

Views: 1159

Answers (2)

TeAmEr
TeAmEr

Reputation: 4773

Check the app category in play store Just parse the page of the play store for that package and get the category it is in. Games have a very distinctive category

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007359

I'm trying to check if an app is a game by its packageName.

By definition, that is impossible. For example, there is no universal definition of what a "game" is.

I know that from API >= 21 you can really check it

No, you can't, as there is no requirement for a game to have that flag set.

Upvotes: 4

Related Questions