Search code examples
androidandroid-c2dmgoogle-cloud-messagingkindlekindle-fire

App with GCM will work in Kindle Fire or need to remove GCM Jar?


Upto now I'm uploading the same binary to Amazon and Google Play store without GCM and both are working fine.

Now I'm going to implement GCM on the same app. Shall I have to maintain the separate code or the same will work ? GCM is not supported by Kindle that I know. All the other functionalities will work as it is ? as App with Google Map API is not working with Kindle.

What if I want to maintain the single version of the App with GCM for Amazon and Google PlayStore.


Solution

  • I think that you would be able to get away with one binary. You would have to do some coding around the missing features but it should be possible. The problem won't be with the GCM.jar it will be with the missing Google Services.

    I don't have access to a Kindle Fire but I imagine that the problem on it would be similar to the problems you face trying to run a GCM app on the emulator without the Google APIs.

    IF that is true then, I think you will have to catch the following exception:

    java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf
    

    That is thrown by:

    // Make sure the device has the proper dependencies.
    GCMRegistrar.checkDevice(this);
    

    And then not call anymore GCM related code if that happens.

    Again I don't have acess to a Kindle Fire but I think that would work.