0

I applied following to distinguish between normal Android OS and Android TV:

if (pm.hasSystemFeature("com.google.android.tv")) {
    // here it is a Android TV
} else {
    // here it is a smartphone or tablet or Car
}

It does not work for Android based TV sticks. I think it works for GoogleTv only?

How can I check for any Android based TV?

Mr.T
  • 72
  • 6
  • There is nothing in the framework that allows you to know what type of system the app is running on let alone just a TV that has Android as the OS, thats still technically just Android – tyczj Nov 04 '20 at 14:39

1 Answers1

0

We match by android.software.leanback OR com.google.android.tv.installed. Where the former is the "official" way to check for it but of course manufacturers always do their own thing.

The latter was chosen by checking out quite a few different devices and we haven't had any complaints about not supporting TV hardware after that.


To publish to the PlayStore with <uses-feature ...> in the manifest, we resorted to publishing two variants, each with one of the features as a requirement...

JensV
  • 3,997
  • 2
  • 19
  • 43