Kindle is based off of the Android operating system, and therefore, uses many of the same conventions. Follow the Android Step-By-Step Guide for initial set up for Amazon Kindle.
This guide will show you how to acquire Amazon Device Messaging (ADM) API Keys, Client IDs, and Client Secret authentication values so you can send to your Kindle Devices.
Make sure you are building your apps with the newest Android + Kindle framework (use the same Android-based framework for each platform) on GitHub.
Oracle only supports the use of Oracle Push Cloud Service SDK in mobile apps. We strongly recommend not using other vendors' SDKs in the same mobile app as the Oracle Push Cloud Service SDK, because we do not support mobile apps configured with push SDKs from other vendors.
[1] Follow the steps here to obtain an API key. Place the key in a file named api_key.txt
in your application's assets
folder. This file must not contain any spaces or line breaks.
NOTE: When copying + pasting, be sure to remove any additional spaces before or after the API Key in your text file, as these spaces will cause the API Key to be misread.
[2] Obtain a Client ID and Client Secret from Amazon and add them to your Amazon Kindle platform on our Web Dashboard.
[3] Once that is done, download the pushio_config_adm.json
file from the Web Dashboard under the Kindle platform you just configured and place it in your application's assets folder. Both the pushio_config.json
(from GCM) and pushio_config_adm.json
(Kindle) files are necessary if you wish to support both platforms.
[1] Add the Amazon namespace declaration to your manifest:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:amazon="http://schemas.amazon.com/apk/res/android"
...
>
[2] Add the following two uses-permissions (replacing com.YourBusiness.YourApplication
with your application namespace):
<uses-permission android:name="com.YourBusiness.YourApplication.permission.RECEIVE_ADM_MESSAGE" />
<uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
[3] Add the following permission (replacing com.YourBusiness.YourApplication
with your application namespace):
<permission android:name="com.YourBusiness.YourApplication.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
[4] At the top of the application element, enable ADM by adding:
<application >
<amazon:enable-feature android:name="com.amazon.device.messaging" android:required="true"/>
...
</application
[5] Define a broadcast receiver for receiving ADM intents (replacing com.YourBusiness.YourApplication
with your application namespace):
<application >
...
<receiver android:name="com.pushio.manager.PushIOADMBroadcastReceiver" android:permission="com.amazon.device.messaging.permission.SEND" >
<intent-filter>
<action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
<action android:name="com.amazon.device.messaging.intent.RECEIVE"/>
<category android:name="com.YourBusiness.YourApplication" />
</intent-filter>
</receiver>
</application>
That's it! Build and run your application as you normally would. The PushIOManager framework will recognize your ADM-enabled application based off the designated permissions, and will attempt to register the device with the service if configured and authenticated properly.
NOTE: There may be services and intents with Google Cloud Messaging (GCM) namespaces - that is, PushIOGCMIntentService
. However, don't be alarmed as they are built to handle both GCM and ADM.