Reputation: 408
I have an app that supposed to work on android TV, so befor posting it on App Store I wanted to test it on my own Android TV.
But when I install it I have 3 problemes :
1) I don't know why but my permissions doesn't seems to work
2) My app isn't dipslayed on the menu, you can only find it on settings-->app
3) The icon is the android default icon and not my own icon
Here's my manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.package">
<!-- read sd card -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- write sd card -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- location -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- internet -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- internet state -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- to disable recent app button -->
<uses-permission android:name="android.permission.REORDER_TASKS" />
<!-- AccountManager -->
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<!-- same -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- don't rember -->
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity android:name=".MainActivity"
android:banner="@drawable/my_logo_temp"
android:icon="@drawable/my_logo_temp"
android:label="@string/app_name"
android:logo="@drawable/my_logo_temp"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".account.AuthenticatorService"
android:exported="true"
android:process=":auth" >
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/auth" />
</service>
</application>
</manifest>
Upvotes: 0
Views: 299
Reputation: 3101
Here is the answer hope this Help you.
Case 3 : Remove banner and icon from Mainactivity It should be always on Application tag so put it in the application tag.
Case 2 : Remove Existing Theme and Apply android:theme="@style/Theme.Leanback" on application tag.
I always Prefer to write this much of code when start developing TV application.
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<uses-feature
android:name="android.hardware.faketouch"
android:required="false" />
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.nfc"
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />
<uses-feature
android:name="android.hardware.microphone"
android:required="false" />
<uses-feature
android:name="android.hardware.sensor"
android:required="false" />
<supports-screens
android:largeScreens="true"
android:normalScreens="false"
android:requiresSmallestWidthDp="720"
android:smallScreens="false"
android:xlargeScreens="true" />
<-- Your Permission -->
<-- You Application Tag -->
Don't Forget to add compile 'com.android.support:leanback-v17:23.2.1' dependency in your build.gradle file. I was used this dependency when created the app you can change the version according to your project.
Try this one may be this help you.
For Case 1 : Permission issue it will be resolved if do all the above steps.
Upvotes: 1
Reputation: 625
Put your "logo" icon in the mipmap
folder and change the following:
android:banner="@mipmap/my_logo_temp"
android:icon="@mipmap/my_logo_temp"
android:logo="@mipmap/my_logo_temp"
Upvotes: 0