Mate Križanac
Mate Križanac

Reputation: 268

Android TV app runs on mobile

I want to create app that targets only Android TV. I use this in my manifest

<uses-feature android:name="android.software.leanback" android:required="true" />

considering on developers.android it says:

If you set the required attribute value to true, your app will run only on devices that use the Leanback UI.

But i can run my app on any device(tablet, phone or TV). Am i doing something wrong? I also added activity with android.intent.category.LEANBACK_LAUNCHER.

Does this only happen in debug mode? And if so, does this allows me to test my TV app on devices like Android mini pc or Kindle Fire?

Upvotes: 2

Views: 1711

Answers (2)

atariguy
atariguy

Reputation: 407

I found that by setting as you did, it limits the device compatibility on Google Play. But you can still test on other devices using adb (it works OK with 7 and 10 inch tablets, but the UI is too big for my Nexus 4). However, you can only launch through adb. The icon will not show up on non-Android TV devices even though it is installed.

Upvotes: 2

CommonsWare
CommonsWare

Reputation: 1007554

Am i doing something wrong?

Not that I can see.

Does this only happen in debug mode?

It happens when you are not distributing through a distribution channel like the Play Store. Quoting the docs for <uses-feature>:

The purpose of a declaration is to inform any external entity of the set of hardware and software features on which your application depends.

Here, "external entity" primarily is a distribution channel, though in principle it could be anything else that has access to the APK and chooses to examine it.

Upvotes: 1

Related Questions