Flutter Android TV Apps checklist. Part 1 — basic requirements.

Polinc
3 min readJul 28, 2022

--

Flutter 3 as of year 2022 supports six platforms: Android, iOS, Linux, MacOS, Windows and Web. None of them is related to any kind of TV device. Nonetheless, the majority of smart TVs are powered by AndroidTV system, which is just a slightly modified version of a regular Android system. That’s why it is quite simple to run the app on an Android TV device as any kind of app made in Flutter may be turned into an TV app with few tweaks.

Google’s official documentation provides us with a list of requirements, recommendations and/or tips as for tv apps. Most of them are common for both native android and Flutter based apps. This checklist covers the main aspects of development for both apps and games and provides guidelines to ensure that your app provides the best possible experience.

TV Support requirements

1. Update project target to Android 5.0. In order to access new APIs for TV devices, one must create a project that targets Android 5.0 (API level 21) or higher. Also SDK tools must be of version 24.0.0 or higher.

android {compileSdkVersion 31defaultConfig {minSdkVersion 21targetSdkVersion 31}

2. Identify the main TV activity with the category LEANBACK_LAUNCHER filter in the manifest (android/app/src/main/AndroidManifest.xml). This enables the app for Android TV and lets the Google identify it as a TV application.

<activity android:name=”.MainActivity”<intent-filter><action android:name=”android.intent.action.MAIN”/><category android:name=”android.intent.category.LEANBACK_LAUNCHER” android:required=”false” /><! — TV →<category android:name=”android.intent.category.LAUNCHER”/></intent-filter></activity>

3. Enable Leanback UI required for Android TV. If the app is designed to run on both mobile devices as well as Android TV, we need to set the required attribute value to false.

<manifest xmlns:android=”http://schemas.android.com/apk/res/android"package=”…”><uses-feature android:name=”android.software.leanback” android:required=”false” /></manifest>

4. Identify the app as not requiring a touchscreen which is needed for the app to be considered as an Android TV app.

<manifest xmlns:android=”http://schemas.android.com/apk/res/android"package=”…”><uses-feature android:name=”android.hardware.touchscreen” android:required=”false” /></manifest>

5. Provide a home screen banner. Launcher app banner must be of 320x180 px. Banner should be located in the drawables/xhdpi or drawables/ directory and include localized text to identify the app.

<application
android:name=”io.flutter.app.FlutterApplication”
android:label=”flutter_android_tv”
android:banner=”@drawable/banner”
android:icon=”@mipmap/ic_launcher”>

</application>

6. Do not declare a requirement for hardware that might be unsupported. Android apps can declare hardware feature requirements in the app manifest to ensure that they do not get installed on devices that do not provide those features. You must declare that your app does not require hardware features which are unavailable on TV devices, even though your app may use these features on non-TV devices:

<uses-feature android:name=”android.hardware.touchscreen”
android:required=”false”/>
<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”/>
<! — Some TV devices have an ethernet connection only →
<uses-feature android:name=”android.hardware.wifi”
android:required=”false”/>

7. Ensure permissions do not imply hardware requirements. Some uses-permission manifest declarations may imply hardware features. It means that requesting some permissions in the app manifest can exclude your app from from being installed and used on TV devices.

  • RECORD_AUDIO — android.hardware.microphone.
  • CAMERA — android.hardware.camera and android.hardware.camera.autofocus.
  • ACCESS_COARSE_LOCATION — android.hardware.location android.hardware.location.network (Target API level 20 or lower only.).
  • ACCESS_FINE_LOCATION — android.hardware.location android.hardware.location.gps (Target API level 20 or lower only.)
  • ACCESS_WIFI_STATE, CHANGE_WIFI_STATE — android.hardware.wifi

These are basic requirements needed to enable a regular Flutter application as an Android TV.

--

--