0

I am witting an single app which can run in Nook, Kindle and also Google play. I am trying to hide some buttons for only Kindle devices. I use Modules.manufacturer.equals("Amazon") for this condition and it works in devices. But when I submit my app in the kindle store for review it doesn't. And every time they rejecting the app because that button redirect to google play. It so wired for me.. Any suggestion.

Thanks in Advance.

Sniper
  • 2,412
  • 11
  • 44
  • 49

2 Answers2

1

It's actually possible to download Amazon Appstore applications for other devices, not just Kindle devices, so the only way to fix it is to submit a different binary for Amazon Appstore vs. Google Play.

Waynn Lue
  • 11,344
  • 8
  • 51
  • 76
  • Thanks!. My main aim is to maintain a single build or source for the three markets. Any other way to do this. – Sniper Jul 05 '13 at 09:23
  • The way we do this is to have a config setting that changes based on the source control branch, and then have one codebase that branches based on what that setting is. – Waynn Lue Jul 05 '13 at 18:51
  • It's also possible to detect when your app has been downloaded from the Amazon Appstore. Unfortunately, that will not be the case during Amazon's testing of your app, so this doesn't help! – Rich Dec 10 '13 at 09:56
  • @Rich How can you detect that? :) – Waynn Lue Dec 10 '13 at 17:53
  • @WaynnLue With `PackageManager.getinstallerPackageName()`. See my answer: http://stackoverflow.com/a/20524255/328936 – Rich Dec 11 '13 at 16:14
1

The Amazon Appstore is available on non-Kindle devices, and such devices are used during review. You cannot therefore rely on the manufacturer.

There are three possible solutions I know of, although I haven't actually tried any of them yet, myself.

Check which market the app was installed from

PackageManager.getInstallerPackageName() returns com.android.vending when the app was installed by Google's Play Store, and com.amazon.venezia when the app was installed from the Amazon Appstore.

However, if the app was side-loaded, this function will return null, so in order to get through Amazon's review process you will have to default to presuming you're running on Amazon's platform.

Check if the app's signature has changed

Amazon re-sign your app. You can check to see if your app's signature is what it was when you signed it, and then act accordingly. You can find details of how to do this (using PackageManager.GET_SIGNATURES) in Jakar's answer, here.

Just do separate builds

This is probably the most robust solution.

Community
  • 1
  • 1
Rich
  • 7,348
  • 4
  • 34
  • 54