3

I developed an app for Android TV's and released. I want to know how many of the users are directly running the app on their TV's and how many using TV boxes.

Is there a way to detect whether my app is running on Android TV OR Android TV Box programmatically?

Santhosh
  • 4,956
  • 12
  • 62
  • 90

2 Answers2

3

getPackageManager().hasSystemFeature("android.software.live_tv")

Michael Sotnikov
  • 604
  • 3
  • 13
  • sorry, didn't get your question correcly. you can differ "android tv" vs "android box" using that check. But there is no real difference between TV with "android tv" and box with "android tv" – Michael Sotnikov Dec 07 '18 at 14:10
  • I was commenting on the fact you don't say what your function call will tell the caller. – noelicus Dec 07 '18 at 21:03
  • android.software.live_tv is part of Android TV. so it checks if system is android tv – Michael Sotnikov Dec 08 '18 at 21:49
  • This is coming as true for both AndroidTv as well as Firestick. SO not useful. Anything else? – Pratim Jul 23 '20 at 11:27
0

Android TVs and Android TV Boxes are almost identical, at least from the applications point of view. They both identify themselves as having a tv characteristic, which you can get from system properties.

Usually, TV apps should not depend on whether they run on a TV or a box.

But if you feel you should really know, maybe you can tell the problem a bit in detail, and we can help you find the right solution.

ysrhlmky
  • 21
  • 2