Reputation: 2182
I have recently got my app rejected from Amazon Mobile App Distribution Portal with the argument that the Menu->"Rate the App" option redirects to Google Play Store.
In order to be accepted it should redirect to the Amazon Appstore, the Download URL must be http://www.amazon.com/gp/mas/dl/android?p=packagename which of course makes sense.
So I need something like:
String url = isKindle
? "http://www.amazon.com/gp/mas/dl/android?p=packagename"
: "https://play.google.com/store/apps/details?id=packagename";
The question is: how can I distinguish if the app runs on Kindle Fire or on a "native" Android system?
Upvotes: 15
Views: 5601
Reputation: 569
Actually you can skip the check altogether and just link to market://details?id=packagename
Upvotes: 0
Reputation: 883
You could include a link to a general webpage, and then the webpage could redirect the traffic to the Amazon AppStore or to Google Play.
For instance, you could include the link www.yourwebsite.com/getapp, which then would redirect traffic to Google Play or Amazon.
Amazon is unlikely to accept a Google Play link, even with a logic behind.
Upvotes: 0
Reputation: 1745
Be sure to update the Build.MODEL check to handle the new Kindle Fire devices.
These are listed on the bottom of the chart at https://developer.amazon.com/sdk/fire/specifications.html
Upvotes: 5
Reputation: 1740
Good news! Apparently the latest version of the Amazon store finally sets PackageManager.getInstallerPackageName()
to "com.amazon.venezia"
to contrast with Google Play's "com.android.vending"
.
Older apps will still return null
, and I haven't actually verified the API or whether installing the new Store and then upgrading an older app will set the installer. But installing a new app and checking /data/system/packages.xml
indicates installer
is correctly set.
Upvotes: 6
Reputation: 108370
You can read these:
android.os.Build.MANUFACTURER
android.os.Build.MODEL
On a Kindle Fire these return the values 'Amazon' and 'Kindle Fire'.
http://developer.android.com/reference/android/os/Build.html
That should be sufficient for your app to make a determination that it's running on a Kindle Fire.
UPDATE:
The preceding works for the gen 1 Kindle Fire.
Newer models of the Kindle Fire have different values for android.os.Build.MODEL.
https://developer.amazon.com/sdk/fire/specifications.html
Upvotes: 27
Reputation: 6969
Detecting a Kindle Fire is part of the solution, but not the whole solution. The (current) last post in this thread seems to get to the core of "was this installed from the Amazon store" -- which may well be a Kindle Fire, or not!
<snip, slightly edited>
The correct way to determine if an app is installed via Appstore in production mode is by using the onSdkAvailable(boolean isSandboxMode)
method.
Documentation on onSdkAvailable(boolean isSandboxMode) method. Abstract:
PurchasingObserver
with the PurchasingManager
isSandboxMode
will return false onStart()
lifecycle methodOn registering your PurchaseObserver
, you get a async call back, onSdkAvailable(Boolean isSanboxMode)
. If the app is downloaded via the Amazon Client then isSandboxMode
will always return false. This code will work successfully in production mode, however in development/test environment, the isSandboxMode will always return true as the app is not downlaoded via the Amazon Client in test environment.
Upvotes: 4
Reputation: 23483
I would just create 2 apps. One for Android. One for Kindle.
Upvotes: 3