dimanche 13 mai 2018

How to set a TV banner in Cordova?

I don't know how to set the TV banner in Cordova, so the installed app uses it on the home screen.

I'm using cordova-plugin-android-tv which adds android:banner="@drawable/banner" to the <application> element as explain on the documentation:

https://developer.android.com/training/tv/start/start#banner

This is performed at cordova/plugins/cordova-plugin-android-tv/patch.js.

Installing the plugin worked at once and also the TV support. I was able to install the app in an Android TV and there is a launch banner on the home screen. But it's not the banner I've indicated.

The problem is that I don't know how to include the TV banner in Cordova.

I've tried putting it at cordova/res/drawable-xhdpi/banner.png and also at cordova/res/drawable/banner.png.

In config.xml I've included:

<platform name="android">
  <resource-file 
    src="res/drawable-xhdpi/banner.png" 
    target="app/src/main/res/drawable-xhdpi/banner.png" />
</platform>

And also have tried:

<platform name="android">
  <resource-file 
    src="res/drawable/banner.png" 
    target="app/src/main/res/drawable/banner.png" />
</platform>

But I don't see the banner in the Android TV home screen when it's installed.

How is it to be done?

I've checked Android and Cordova documentation, but I don't figure out how to achieve it:

https://developer.android.com/training/tv/start/start#banner

https://developer.android.com/guide/topics/resources/drawable-resource#BitmapFile

http://cordova.apache.org/docs/en/8.x/config_ref/index.html#resource-file

I'm developing the Cordova app with an Ember.js aplication using the Corber plugin. The version is Cordova 8.0.0.




Aucun commentaire:

Enregistrer un commentaire