How Fire TV Development Differs from Android TV Development
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 two versions of Fire OS: Fire OS 5 and 6. Fire OS 5 is a fork of Android 5.1 (Lollipop, API level 22), while Fire OS 6 is based on Android 7.1 (Nougat API, level 25). Fire OS leverages the same Android operating system but also accommodates Amazon hardware and services. 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 Fire TV 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 Fire TV 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 In-App 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.
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). Currently, the only device that runs Fire OS 6 is Fire TV (Gen 3). (Previous Fire TV devices will not be up-leveled at this time.)
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. You can also test your app with the App Testing Service.
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.