question

inveni0 avatar image
inveni0 asked

MyADMMessageHandler has no default constructor

I'm following Amazon's to-do list, but I've hit a place where I can't get onRegistered to trigger, and I wonder if this error is the problem. At first, I got it in my MyADMMessageHandler.java file, but I added a constructor myself. The error, however, is persisting in my manifest file where the service name is declared.

Any ideas how to solve this?

amazon device messagingsdk
10 |5000

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

Levon@Amazon avatar image
Levon@Amazon answered

Hi inveni0,

Thanks for posting on the forums! Have you looked at how it's implemented in the sample provided in the SDK? Check it out under Amazon-Android-SDKs/AmazonDeviceMessaging/examples, it's called 'ADMMessenger' and it contains an AndroidManifest.xml file and corresponding source files that you can compare to yours and see how to implement ADM correctly. Thanks!

4 comments
10 |5000

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

inveni0 avatar image inveni0 commented ·

Yes, I've copied that stuff exactly. I've managed to get the error I mentioned to go away, but onRegistered is still not triggering. I'm even running the sample itself, and can't seem to get anything besides "Retrieving the registration id." to hit the logger.

0 Likes 0 ·
Levon@Amazon avatar image Levon@Amazon ♦ commented ·

What about the configuration on the Dev Portal side? Is everything correct there with the security profile, API key, package name, etc.? Please double-check that as well: login, click on your app, and then 'Device Messaging' link. Glad that one issue has been resolved.

0 Likes 0 ·
inveni0 avatar image inveni0 commented ·

Yes, I have a security profile created and the key embedded in the api_key.txt file with no errors reading this file or starting the registration process.

0 Likes 0 ·
Levon@Amazon avatar image Levon@Amazon ♦ commented ·

Thank you for additional details. Please login to your Dev Portal account, raise a 'Contact Us' case (we need that to associate your account and look into your app), specify the app name, relevant code snippets, log outputs / screenshots (upload this to your cloud storage and provide a link), and include a URL to this forum thread for context, and we will investigate. Thanks!

0 Likes 0 ·
Levon@Amazon avatar image
Levon@Amazon answered

Hi inveni0,

I have replied to your 'Contact Us' case, but will add it here for the sake of other developers. After some investigation, it seems like you have copied the AndroidManifest.xml to your project but haven't made all necessary changes. This manifest file needs your app's details. Here is a guide that can help you: https://developer.amazon.com/public/apis/engage/device-messaging/tech-docs/04-integrating-your-app-with-adm

Please follow it precisely, as the part you missed is from Line 16 to 22. The rest seems OK, but double check anyway. Thanks!

10 |5000

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