How Fire TV Development Differs from Android TV Development (Fire TV)
Because both Amazon Fire TV and Android TV use Android, you can push your same Android app out to both the Amazon Appstore and Google Play Store. Making your app available on both Amazon and Google stores can significantly increase the visibility and downloads of your app.
However, there are some differences with Fire TV that you need to account for in your code. Some of the differences are due to unique elements in the hardware or services. In some cases one service has features the other doesn't have, or they use different but equivalent services.
As you code for these differences, be aware that you can identify Amazon Fire TV devices and adjust your code to target different devices and behavior accordingly.
- What's the Difference Between Amazon Fire TV and Android TV?
- Google Services
- LeanBack Support Library
- Voice Search
- Global Search
- Audio Focus
- Fast-forward, Rewind, and Menu Buttons
- In-app Purchasing
- SDK Level
- Notifications API
- Testing Your App
What's the Difference Between Amazon Fire TV and Android TV?
First, let's clarify what we mean by Android TV and Amazon Fire TV:
- Android TV refers to the Android operating system that has been optimized for TV (starting at Lollipop and continuing through Nougat and beyond). Android Lollipop and the Leanback Support Library provide features that optimize Android for TV platforms. TV devices themselves can run Android TV as their native OS, or TVs can run Android through set-top boxes. You can learn more about Android TV on Wikipedia.
- Amazon Fire TV refers to the Fire TV set-top box or stick that run the Fire operating system (OS) on your TV. There are three versions of Fire OS: Fire OS 5, Fire OS 6, and Fire OS 7. Fire OS 5 is a fork of Android 5.1 (API level 22), while Fire OS 6 is based on Android 7.1 (API level 25), and Fire OS 7 is based on Android 9 (API level 28). Fire OS leverages the same Android operating system but also accommodates Amazon hardware and services. Most Fire tablets also run Fire OS 5 but do not leverage the features typically used for the "10-foot media experiences" on TV platforms. (You can learn more about Fire OS or see the Fire TV Device Specifications.)
The important point is that both Android TV and Amazon Fire TV are Android-based, so the techniques you implement for your app share far more similarities than differences.
The following sections list the differences you need to account for in your code when planning for Fire TV.
Any APIs that rely on Google-specific services, such as Google location services, aren't available on Amazon Fire TV. Although there is an Amazon Maps API as well as an Amazon Mobile Ads API, they are not yet supported on Fire TV.
LeanBack Support Library
Amazon Fire TV supports some but not all of Android's Leanback Support Library. For example, Fire TV uses TV-specific UI components from Leanback, Leanback widgets will work, and Fire TV will honor intents tagged for the
LEANBACK_LAUNCHER. But Leanback's
SearchFragment (described in the next section) is not supported.
For voice search, Android TV uses app controls that rely on Leanback APIs (for example, speech recognition with the
SearchFragment). However, voice search on Amazon Fire TV does not use Leanback's
SearchFragment. On Fire TV, voice search uses Amazon-specific system controls.
No matter where users are on Fire TV (whether on the Launcher or in an app), when users press the microphone button on a voice-enabled remote and say the TV show or Alexa actions they want, this action initiates a global search using the Alexa cloud service instead speech recognition APIs in the Leanback library.
Media requests through voice always return content from the Amazon Catalog. See Implementing Search in Fire TV for more details.
On Android TV, to integrate your content into global search, you can do so locally through your app using a search results
With Amazon Fire TV, to make your content appear in global search results, you must integrate your media content with the Amazon Catalog. Submission to the Catalog is done through a cloud-based model (rather than locally within your app).
If a user starts playing music from a music app prior to starting your app, Amazon Fire TV will continue to play music over your app. The Play/Pause buttons will control the music instead of the video in your app.
To receive the audio focus, your app must register a
MediaButtonReceiver in your the manifest. The
MediaButtonReceiver will transfer the audio focus to your app's media service when your app starts. See Audio Focus for more details and code samples.
Fast-forward, Rewind, and Menu Buttons
Both Android TV and Amazon Fire TV have 4-way directional pad (dpad), dpad_center/select, back, and play/pause buttons. However, Fire TV also offers rewind, fast-forward, and menu buttons that you can optionally use.
The Menu button on Fire TV invokes the Android context menu, which appears as a list of menu items centered on the screen. You can override the menu button to provide your own custom menu user interface, or for any other purpose.
If you only have one menu item, consider using the Menu button as a simple toggle — for example, to turn closed captions on or off. If you do this, consider providing an onscreen hint to expose this feature to your users.
Android TV often uses Google Play Billing for in-app purchases. For in-app purchases on Amazon Fire TV, you use Amazon's In-App Purchasing (IAP) API. For more information, you can see a detailed comparison of the two.
Android TV uses Firebase for Analytics. With Amazon Fire TV, you can use Amazon Mobile Analytics or another analytics package (Google Analytics, Flurry Analytics, Crashlytics, and so on). Many of these analytics packages are configurable as modules if you build your app with Fire App Builder.
If you're using Firebase in your app and are looking to keep using Firebase, you might need to implement some alternatives. The native Firebase SDKs depend on Google Play services, which are not available on Amazon devices. If you're using native Firebase SDKs, you have three main options:
- Disable Firebase on Amazon devices: This might be the minimum viable approach that allows you to learn about your Amazon users and build up the case for investing in an alternative Firebase product.
See Firebase Alternatives in "Migrating An Existing App to the Amazon Appstore" for a more detailed list about equivalents and alternatives to Firebase.
Android TV often runs the latest version of Android (Nougat or API level 25). In contrast, Amazon Fire TV devices can run either Fire OS 5 (based on Lollipop, API level 22) or Fire OS 6 (based on Nougat, API level 25). See Fire OS Versions and Fire TV Device Specifications for information about which devices have which version of Fire OS.
When testing out your Amazon Fire TV app code, you use an actual Fire TV device (either the set-top box or stick) instead of a virtual emulator. See Connect to Fire TV Through ADB for more details.
You use the standard Android Notifications API for creating notifications for your Amazon Fire TV app. Fire TV provides the same toast notifications and persistence model as Android TV. However, in addition to toasts, Fire TV also provides Heads up notifications, which allow interactive buttons.
Additionally, instead of putting old notifications in a notification drawer, on Fire TV notifications are stored in a Notification Center. Learn more at Notifications for Amazon Fire TV.
Amazon Fire TV provides VoiceView to make your app accessible to the visually impaired. You can learn more about VoiceView and accessibility here:
- Assistive Technologies for Fire OS
- Implement Accessibility in Fire OS
- Implementing VoiceView Accessibility Features for Fire TV
Android TV devices use the Google Play Store. In contrast, Amazon Fire TV uses the Amazon Appstore. Any links you have pointing to the Google Play store will need links to the Amazon Appstore.
Testing Your App
You can test your Android app's compatibility with Amazon by sideloading your app onto an Amazon Fire TV device. See Connecting to Fire TV Through ADB.
When you connect to a Fire TV device through ADB and run your app with Android Studio, a successful app will load and play. If you close your sideloaded app, you can find it by going to Settings > Applications > Manage Installed Applications.
Last updated: Oct 29, 2020