-1

My app uses Google Cloud Messenger. Amazon has an alternative version of this. Does the Amazon Device Messaging run on all androids or just Kindles?

Does anyone have a guide for incorporating both Google and Amazon into one app.

While I'm here what do I do about a Fire emulator?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
user462990
  • 5,472
  • 3
  • 33
  • 35

1 Answers1

1

Just refer you to Amazon developer forum https://forums.developer.amazon.com/forums/thread.jspa?threadID=1212

ADM is supported on Kindle Fire HD 8.9" 4G, Kindle Fire HD 8.9", Kindle Fire HD 7", and Kindle Fire (2nd Generation) devices. It IS NOT supported in Kindle Fire 1st generation.

As stated in the documentation you can differentiate if the device running your APK has Amazon services or not.

If you specify android:required="false" in your AndroidManifest.xml your app must degrade gracefully if ADM is unavailable.

<amazon:enable-feature android:name="com.amazon.device.messaging" android:required="false" />

Use code similar to the following to check for ADM:

boolean admAvailable = false ;
try
{
    Class.forName( "com.amazon.device.messaging.ADM" );
    admAvailable = true ;
}
catch (ClassNotFoundException e)
{
    // Handle the exception.
}

Add the following code to any of your code that requires the ADM library runtime.

if (admAvailable )
{
    // Your code that requires ADM goes here.
}

This is already documented here : https://developer.amazon.com/appsandservices/apis/engage/device-messaging/tech-docs/04-integrating-your-app-with-adm#Gracefully%20Degrade%20if%20ADM%20Is%20Unavailable

TylerH
  • 20,799
  • 66
  • 75
  • 101
Jorge
  • 1,353
  • 10
  • 25