ADT-1 Developer Box (Android TV) Build Settings

I received the ADT-1 Developer Box in the mail on Tuesday and I was able to create a Corona SDK game that runs on it using the game controller. However, when I publish it to Google Play, it says that is not compatible with the ADT-1.

I believe it has something to do with the manifest file. Since we cannot edit the manifest in Corona SDK, I’ve been trying different build settings, but none of them seem to work.

Here’s my build.settings:

settings ={ orientation =   { default = "landscapeRight", supported =   { "landscapeRight", "landscapeLeft" }, }, android =    {     mainIntentFilter =     {       categories =       {         "android.intent.category.LEANBACK\_LAUNCHER",          "android.intent.action.MAIN"       },     },     activities =     {       "com.gpanimations.mbsttv.TvActivity"     },     usesPermissions =     {      },   }, }

And that’s based off the documentation (https://developer.android.com/training/tv/start/start.html) that you need the following in the manifest:

<activity

    android:name=“com.example.android. TvActivity
    android:label="@string/app_name"
    android:theme="@style/Theme.Leanback">

    <intent-filter>
      <action android:name=“android.intent.action.MAIN” />
      <category android:name=" android.intent.category.LEANBACK_LAUNCHER" />
    </intent-filter>

  </activity>

I think it’s the TVactivity line that isn’t being read and hence making it show as incompatible on the Play Store. Any suggestions would be greatly appreciated.

We don’t support the Android TV yet.  We just got one to play with, but with all the other things we have going on, we haven’t had time to look into it.

I’m not an Android expert, but perhaps you could try this:

    mainIntentFilter =
    {
      categories =
      {
        “android.intent.category.LEANBACK_LAUNCHER”,

      },

      actions =

      {
        “android.intent.action.MAIN”
      },
    },

Hey Rob, thanks for the reply. When I build it using the code you mentioned and then look at the manifest file in Terminal, it does show up:

&nbsp;E: action (line=54) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; E: category (line=55) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="android.intent.category.LEANBACK\_LAUNCHER" (Raw: "android.intent.category.LEANBACK\_LAUNCHER") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; E: category (line=56) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")

However, the TvActivity never show sup under Activities, I think that’s the issue. I don’t know how to make it appear there.

E: activity (line=62) &nbsp; &nbsp; &nbsp; &nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="com.ansca.corona.CameraActivity" (Raw: "com.ansca.corona.CameraActivity") &nbsp; &nbsp; &nbsp; &nbsp; A: android:screenOrientation(0x0101001e)=(type 0x10)0x1 &nbsp; &nbsp; &nbsp; &nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp; &nbsp; &nbsp; E: activity (line=66) &nbsp; &nbsp; &nbsp; &nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="com.ansca.corona.VideoActivity" (Raw: "com.ansca.corona.VideoActivity") &nbsp; &nbsp; &nbsp; &nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp; &nbsp; &nbsp; E: activity (line=69) &nbsp; &nbsp; &nbsp; &nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="com.ansca.corona.purchasing.StoreActivity" (Raw: "com.ansca.corona.purchasing.StoreActivity") &nbsp; &nbsp; &nbsp; &nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0

I was making a stab in the dark.

No problem. I think it’s just because it’s not officially supported yet. All of the listings for activities start with:

com.ansca.corona.ActivityNameHere

So I’m thinking it doesn’t matter how I set up the build.settings, it will never show com.company.TvActivity, which is what makes it show up as ADT-1 Compatible on the Play Store. At least I know that apps made in Corona do run on it, and I know the game controller button codes.

Engineering is going to look into this, but no ETA.

Rob

We don’t support the Android TV yet.  We just got one to play with, but with all the other things we have going on, we haven’t had time to look into it.

I’m not an Android expert, but perhaps you could try this:

    mainIntentFilter =
    {
      categories =
      {
        “android.intent.category.LEANBACK_LAUNCHER”,

      },

      actions =

      {
        “android.intent.action.MAIN”
      },
    },

Hey Rob, thanks for the reply. When I build it using the code you mentioned and then look at the manifest file in Terminal, it does show up:

&nbsp;E: action (line=54) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; E: category (line=55) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="android.intent.category.LEANBACK\_LAUNCHER" (Raw: "android.intent.category.LEANBACK\_LAUNCHER") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; E: category (line=56) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")

However, the TvActivity never show sup under Activities, I think that’s the issue. I don’t know how to make it appear there.

E: activity (line=62) &nbsp; &nbsp; &nbsp; &nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="com.ansca.corona.CameraActivity" (Raw: "com.ansca.corona.CameraActivity") &nbsp; &nbsp; &nbsp; &nbsp; A: android:screenOrientation(0x0101001e)=(type 0x10)0x1 &nbsp; &nbsp; &nbsp; &nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp; &nbsp; &nbsp; E: activity (line=66) &nbsp; &nbsp; &nbsp; &nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="com.ansca.corona.VideoActivity" (Raw: "com.ansca.corona.VideoActivity") &nbsp; &nbsp; &nbsp; &nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0 &nbsp; &nbsp; &nbsp; E: activity (line=69) &nbsp; &nbsp; &nbsp; &nbsp; A: android:theme(0x01010000)=@0x1030007 &nbsp; &nbsp; &nbsp; &nbsp; A: android:name(0x01010003)="com.ansca.corona.purchasing.StoreActivity" (Raw: "com.ansca.corona.purchasing.StoreActivity") &nbsp; &nbsp; &nbsp; &nbsp; A: android:configChanges(0x0101001f)=(type 0x11)0x4a0

I was making a stab in the dark.

No problem. I think it’s just because it’s not officially supported yet. All of the listings for activities start with:

com.ansca.corona.ActivityNameHere

So I’m thinking it doesn’t matter how I set up the build.settings, it will never show com.company.TvActivity, which is what makes it show up as ADT-1 Compatible on the Play Store. At least I know that apps made in Corona do run on it, and I know the game controller button codes.

Engineering is going to look into this, but no ETA.

Rob

any updates about this?

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!

any updates about this?