Configure the manifest (Android v4 | Fire TV)

Configure the manifest in your Android app or Fire TV project.







Implementation

To complete the SDK import process, use the following Android or Fire TV steps to configure AndroidManifest.xml.


Android

  1. In app/manifests/AndroidManifest.xml, in all <activity> elements that will contain a player, add android:configChanges="keyboard|keyboardHidden|orientation|screenSize". This prevents the Activity from being destroyed when rotated.

  2. (Optional) If your app reads media content from the user's device, add <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>.

    πŸ’‘

    Android's Request App Permissions guide explains how requesting permissions works.


<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application>
    ...
    <activity
        ...
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
  
</application>


Fire TV

In app/manifests/AndroidManifest.xml, add <uses-feature android:name="android.hardware.touchscreen" android:required="false" />. Since touchscreen support is assumed for all Android APKs, this explicitly declares that a touchscreen is not required.

πŸ’‘

To learn more about building apps for Fire TV, read Troubleshooting Android Manifest and Device Filtering.


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    ...
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <application>
    ...
    </application>

</manifest>


What’s Next