I thought they had it basically working. But its been a while. Are you having particular errors?
Rob
I thought they had it basically working. But its been a while. Are you having particular errors?
Rob
I have just build with daily build 2676 and no errors that I can see, but when uploading the APK to the Google Play store, it tells me
Android TV
Add a Leanback launch intent to distribute your app on Android TV. Learn more
Here’s the relevant part of the AndroidManifest.xml, which shows that the properties for Android TV are still missing form the activity tag.
\<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="Hoppy Naut" android:launchMode="singleTask" android:name="com.ansca.corona.CoronaActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"\> \<meta-data android:name="supportsOrientationPortrait" android:value="false"/\> \<meta-data android:name="supportsOrientationPortraitUpsideDown" android:value="false"/\> \<meta-data android:name="supportsOrientationLandscapeRight" android:value="true"/\> \<meta-data android:name="supportsOrientationLandscapeLeft" android:value="true"/\> \<intent-filter\> \<action android:name="android.intent.action.MAIN"/\> \<category android:name="android.intent.category.LEANBACK\_LAUNCHER"/\> \<category android:name="tv.ouya.intent.category.GAME"/\> \<category android:name="android.intent.category.LAUNCHER"/\> \</intent-filter\> \</activity\>
According to the documentation, the application should have an activity for Android TV in addition to the regular android launcher activity:
\<application android:banner="@drawable/banner" \> ... \<activity android:name="com.example.android.MainActivity"\<-- this is actually com.ansca.Corona.CoronaActivity--\> android:label="@string/app\_name" \> \<intent-filter\> \<action android:name="android.intent.action.MAIN" /\> \<category android:name="android.intent.category.LAUNCHER" /\> \</intent-filter\> \</activity\> \<activity \<-- this second activity tag is missing --\> android:name="com.example.android.TvActivity" android:label="@string/app\_name" android:theme="@style/Theme.Leanback"\> \<intent-filter\> \<-- this is being included in the activity for com.ansca.Corona.CoronaActivity --\> \<action android:name="android.intent.action.MAIN" /\> \<category android:name="android.intent.category.LEANBACK\_LAUNCHER" /\> \</intent-filter\> \</activity\> \</application\>
See inline above for my editorial comments. In current builds, we only get the activity for com.ansca.Corona.CoronaActivity. Also, the intent-filter for LEANBACK_LAUNCHER is being included in the same activity, when it really should be in the TvActivity activity. At least, that’s how I am interpreting the documentation.
Additional notes:
In addition to including the correct activity/intent-filter, you need to declare 2 additional things in the manifest:
<uses-feature android:name=“android.software.leanback” android:required=“false” />
<uses-feature android:name=“android.hardware.touchscreen” android:required=“false” />
The docs state that these must be present for the app to appear in the Play store for TV devices.
Corona does support Android TV. Have a look at the following blog entry on how to set up your app for it…
https://coronalabs.com/blog/2015/01/13/tutorial-creating-android-tv-apps/
And here are the related documentations links that go with it.
https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#android-tv
https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#android-tv-1
It’s pretty easy to add. Once you do the above, the Corona Simulator build system will inject all of the right things into the AndroidManifest.xml file for you.
Thanks for the pointers! I somehow missed this in the search but I can see the answer boiled down to:
settings = {
android = {
supportsTV = true,
isGame = true,
}
}
i will try it out this weekend.
i can confirm setting supportsTV and isGame to true in the build.settings as in my previous post is working! thank you for the pointer, Joshua.
Great! Yeah, we tried to make it as easy as possible for everyone.
And you just need a “Banner-xhdpi.png” image file too (if you haven’t done so already) and then you’re good to go!