question

Tiffany Ip avatar image
Tiffany Ip asked

Attempting to test ADM, com.amazon.device.messaging.ADM not available

Hello, I'm implementing the ADM into an Unity3D Android app. I have no difficulty building the JAR file after following instructions regarding using amazon-device-messaging-x.x.x.jar as reference for compiling only. I didn't include that jar either into my Unity3D project to prevent to it being called for the stubs exceptions. When I'm running my app on my Kindle Fire HDX 8.9 3rd Gen, it just doesn't find the ADM class. Here is my code snippet: import com.amazon.device.messaging.ADM; ... try { Util.sendMessage("OnRegister", "Testing for ADM class"); //sends info to Unity Class.forName("com.amazon.device.messaging.ADM"); admAvailable = true; } catch (Exception e) { Log.w(TAG, "Adm not available!"); Util.sendMessage("OnError", "Adm not available!"); //sends info to Unity } I get 'Adm not available!' Am I missing something? I thought the device should provide the library classes at runtime since I read somewhere that they are all included already? Thanks
amazon device messaging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tiffany Ip avatar image
Tiffany Ip answered
Since I couldn't edit my post (why?) I'm posting additional info here: Android Manifest:
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DougM@Amazon avatar image
DougM@Amazon answered
Hello Tiffany, We don't specifically support integrating the Amazon Device Messaging within the Unity engine. However, depending on how you are building your plugin, you may actually want to change the exceptions from being the default Exception class to specifically java.lang.ClassNotFoundException as the documentation of Class.forName only describes that exception is throwable. Just to make sure something else isn't going wrong instead. http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#forName(java.lang.String)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.