Devices running Fire OS 7 and previous Fire OS releases
Android changes in Fire OS 7
The upgrade from Fire OS 6 to Fire OS 7 requires a transition from Nougat (Android 7.1.2) through Oreo (Android 8.0) to Pie (Android 9). Changes introduced in Android 8.0 and Android 9 require you to make code changes in your app before the app will work correctly on Fire OS 7 devices.Android 8.0 changes
Major changes in Android 8.0 include the following:- Notification Channels: All notifications must be associated with a channel. For information about channels, see Android training for Notification Channels. For sample code and additional details, see the Notifications in Fire OS 7 section below.
- Background Services: Android 8.0 limits the use of background services. As a result, any apps using background services to refresh their recommendations will fail to refresh the recommendations on Fire OS 7. Android recommends using JobSchedulers as a workaround for the limitation with background services. See Background Services.
- Native Libraries: Native libraries no longer load if they contain any load segment that is both writable and executable.
- Permissions: Apps need to explicitly request each permission, even within the same permission group.
- MediaSession events: Your app needs to use MediaSession correctly to handle audio. See the Android 8.0 documentation on Finding a media session. When Android handles events, if the foreground activity doesn’t have an active media session to handle the event, Android will look for other media sessions. See also Requirements for Multimedia Apps on Fire TV.
Android 9 changes
Major changes in Android 9 include only the following:- Privacy changes: Apps will have restricted access to wifi. Apps will have limited access to user inputs and sensor data while running in the background.
Fire OS 7 parity with Android 9
All features implemented in Fire OS 7 are at feature parity with Android 9. This doesn’t necessarily mean that everything in Android 9 is available in Fire OS 7, but for those Android 9 features implemented in Fire OS 7, they have parity. Some Android 9 features, such as split-Screen, notification dots, and adaptive icons, aren’t supported in Fire OS 7. Also, remember that although Fire OS 7 has parity with Android 9, you can’t use Google services on Amazon Fire devices. Instead, you must use the Apps & Games Services SDKs for the services you need (such as in-app purchasing).Targeting your app for Fire OS 7 devices
Users might run your app on a Fire OS 5, Fire OS 6, or Fire OS 7 device. To maximize your app compatibility with the Fire OS version on the device, we recommend that you target the device based on the SDK level. In your code, you can check whether theBuild.VERSION.SDK_INT is greater than or equal to 28 (The Android 9 API level) to target Fire OS 7 devices.
Also see Supporting Different Platform Versions in the Android documentation.
Testing your app’s compatibility on Fire OS 7 devices
Currently, you can test your app’s compatibility with Fire OS 7 by connecting to an actual device.What to set for minSdkVersion and targetSdkVersion
Set yourminSdkVersion to the minimum API level for the applicable Fire OS version.
| Fire OS Version | minSdkVersion |
|---|---|
| Fire OS 7 | 28 |
| Fire OS 6 | 25 |
| Fire OS 5 | 22 |
targetSdkVersion to the highest API level that you’ve tested your app against.
See Device Filtering and Compatibility for more information on minimum API level requirements.
Understanding how minSdkVersion affects supported devices
In your app manifest (orbuild.gradle file), the minSdkVersion attribute sets the minimum SDK level that your app needs in order to function properly. (Devices that don’t support that API level won’t allow the app to be installed on that device — this is how device filtering and compatibility works with the Appstore.)
Fire OS 5 devices are based on API level 22 (Lollipop 5.1). Fire OS 7 devices are based on API level 28 (Android 9). By setting the minSdkVersion to 22, you’re saying that your app requires the device to have at least API level 22 for it to function properly.
By setting the minSdkVersion to 22, your app will also install on any devices that have a higher API level (such as 28), because Android levels are backwards-compatible. API level 28 usually includes all the APIs for levels 1 through 28 (each release adds to the previous).
However, suppose you want to take advantage of APIs in Android 9 (API level 28). If you set your minSdkVersion to 22, your app will install on Fire OS 5 devices that don’t have level 28 APIs. Therefore, you must code in a defensive way to check the device level and fall back to alternatives if the device doesn’t support that API level. Your code might look something like this:
targetSdkVersion
else logic.
By default, if the targetSdkVersion is not specified, it uses the same value as the minSdkVersion. The targetSdkVersion lets you set the latest API level that you have tested your app against. Based on this value, Android will ensure proper behavior on devices at this level.
For example, if you set your targetSdkVersion to 23 or higher (Marshmallow’s release), Android will apply the runtime permission checking features included in Marshmallow. But if targetSdkVersion is lower than 23 (prior to the runtime permission checking release in Marshmallow), Android will not apply this behavior to your app.
Although not recommended, if you need to prevent older apps from appearing on Fire OS 7 devices, you may set maxSdkVersion to Fire OS 5 (22).
For more information, see the following:
<uses-sdk>- Supporting Different Platform Versions
- Picking your compileSdkVersion, minSdkVersion, and targetSdkVersion
Notifications in Fire OS 7
As of Android Level 8.0 (API level 26), notifications that your app sends must be assigned to a channel. (Recommendations are a kind of notification.) If your app sends notifications or recommendations, you must create a channel and associate the channel with the notification. A notification without a channel ID will be dropped. At a high-level, to add a channel to a notification, you do the following:- Step 1: Create the notification channel and register it with the notification manager.
- Step 2: Set the channel ID for the notification, using one of the following methods:
Step 1: Create the notification channel and register it with the notification manager
The following is from Create a notification channel in the Android documentation:Create a notification channel To create a notification channel, follow these steps:
- Construct a
NotificationChannelobject with a unique channel ID, a user-visible name, and an importance level.- Optionally, specify the description that the user sees in the system settings with
setDescription.- Register the notification channel by passing it to
createNotificationChannel.
Step 2: Set the channel ID for the notification
You have two options for setting the channel ID for the notification. You can either useContentRecommendation and use reflection to set the channel ID, or you can use Notification.Builder.
Option 1: Use createContentRecommendation and use reflection to set the channel ID
Notification.Builder with channel ID
The following code is adapted from the Android Open Source Project on Google Git.
Amazon Device Messaging (ADM) compatibility
If your app uses Amazon Device Messaging, you need to update the SDK to avoid crashes on Fire OS 7. In previous releases, ADM usedIntentService to send messages to client applications running in the background. In Fire OS 7, IntentService is subject to all the background execution limits imposed with Android 8.0 (API level 26). For example, according to Background Service Limitations in the Android documentation:
In order for apps to receive ADM messages while running in the background, they must use aIntentServiceis a service, and is therefore subject to the new restrictions on background services. As a result, many apps that rely onIntentServicedo not work properly when targeting Android 8.0 or higher. For this reason, Android Support Library 26.0.0 introduces a newJobIntentServiceclass, which provides the same functionality asIntentServicebut uses jobs instead of services when running on Android 8.0 or higher.
JobIntentService. This newer class uses jobs instead of services when running on Android 8.0 or higher.
ADMMessageHandlerJobBase is a new class that will use JobIntentService to deliver messages in the background. You should use this class in place of the old ADMMessageHandlerBase. When creating an app which interacts with ADM, you should extend ADMMessageHandlerJobBase in your handler. To follow along with an example, see Implement Handling for Registration and Messages. Additionally, see also Set Up Amazon Device Messaging and Update your App Manifest, which were also updated as part of the release.
You can download the updated ADM SDK here.

