Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Develop
Test
Publish
Monetize
Engage users
Device specifications
Resources
Skip to main content
1. Explore - Know your options2. Choose - Find a solution3. Fit - Update your code4. Verify - Test your app5. Push - Submit your app
Amazon Device Messaging (ADM) has similarities to Firebase Cloud Messaging (FCM) which will be called out in this guide. Your familiarity with FCM can help you get started with ADM. First, download the ADM SDK, set up your Android Studio project with ADM, then continue with the following steps. On this page, learn how to update your app’s manifest to be compatible with ADM.

Update your app manifest

To receive messages, you must update your AndroidManifest.xml file. When setting up your app with FCM, you likely extended the FirebaseMessagingService class and added your subclass as a service in your app’s manifest. With ADM, you must extend three ADM classes and add your subclasses as services in your manifest. For descriptions of these classes, see Implement registration and message handling. You must also add permissions and explicitly enable ADM in your manifest file. The following instructions provide the details to make these updates.
  1. Open your AndroidManifest.xml file and add the Amazon namespace:
  2. To declare the permissions necessary to support ADM, after the manifest element, add the permission and uses-permission elements.
  3. Explicitly enable ADM and declare whether your app requires ADM (android:required="true") or can work without ADM being present (android:required="false"). If you specify android:required="false", your app must degrade gracefully if ADM is unavailable. In the application node of the manifest, add the uses-library element.
  4. Declare a broadcast receiver to handle the REGISTRATION and RECEIVE intents that ADM sends. ADM requires that the receiver be defined in the AndroidManifest.xml file, rather than programmatically. Immediately after uses-library add the following elements.
  5. After updating your AndroidManifest.xml file, you can confirm that the changes are correct for ADM by calling ADMManifest.checkManifestAuthoredProperly(). If you receive a java.lang.NoClassDefFoundError: com.amazon.device.messaging.ADM error, check your manifest to verify that you have added the uses-library element in the location specified in step 3.
The following code is a complete example of an AndroidManifest.xml file enabled for ADM.

Next steps

Go to the next step: Obtain and Store Your API Key.
Last modified on March 24, 2022