I'm integrating Amazon device messaging into my app following this Official docs. According to the docs, I have to create a class (MyADMMessageHandler.java) that extends ADMMessageHandlerJobBase and declare my class as a Service in AndroidManifest.xml
But when I built my app, I got this error
AndroidManifest.xml:153: Error: MyADMMessageHandler must extend android.app.Service [Instantiatable] <service android:name=".pn.MyADMMessageHandler"
Explanation for issues of type "Instantiatable":
Activities, services, broadcast receivers etc. registered in the manifest file (or for custom views, in a layout file) must be "instantiatable" by the system, which means that the class must be public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class.
1 errors, 0 warnings
BUILD SUCCESSFUL in 18s
Despite of this error, I still had BUILD SUCCESSFUL. I decompiled amazon-device-messaging-1.1.0.jar to see what's going on, but it just contains stub implementation and ADMMessageHandlerJobBase doesn't extends Service or any subclass of Service.
Note: In the sample code of Amazon device messaging, it also did the same.
So, my question is:
- MyADMMessageHandler class isn't a Service but why do we need to declare it as a Service in AndroidManifest.xml?
- Is it ok to remove this declaration from AndroidManifest.xml? or Is it required?