问题
Is there a way to start an Intent on the Kindle Fire that will cause the AppStore app to open and display all the apps for a certain developer? For instance, on a phone/tablet with the Android Market installed, I can do this:
Intent otherApps = new Intent(Intent.ACTION_VIEW,Uri.parse("market://search?q=pub:\"" + developerName + "\""));
activity.startActivity(otherApps);
And show all my apps in the Android Market. Can I do that with the Amazon App Store? If so, how? I've tried that Intent with other seemingly valid names (such as "ZeptoLab") and I don't get any filtering. It just drops me in the full unfiltered App Store. Looking up a specific app with "market://details?id=package.name" does seem to work.
回答1:
From https://developer.amazon.com/help/faq.html#Marketing:
To point to your app for marketing purposes use the URL http://www.amazon.com/gp/mas/dl/android?p=packagename (where packagename is your app package name).
If you want to link to the list of all your applications on the Amazon Appstore use the URL http://www.amazon.com/gp/mas/dl/android?p=packagename&showAll=1.
e.g. http://www.amazon.com/gp/mas/dl/android?p=com.rovio.angrybirds&showAll=1
All this can be seen here: https://developer.amazon.com/sdk/in-app-purchasing/sample-code/deeplink.html
Update(deep linking):
amzn://apps/android?p=
回答2:
Best way is to look at their website (or here), which currently states this :
search: amzn://apps/android?s=amazon%20mp3 or http://www.amazon.com/gp/mas/dl/android?s=amazon%20mp3
detail page using package name: amzn://apps/android?p=com.amazon.mp3 or http://www.amazon.com/gp/mas/dl/android?p=com.amazon.mp3
detail page using unique ID ("asin") : amzn://apps/android?asin=B004FRX0MY or http://www.amazon.com/gp/mas/dl/android?asin=B004FRX0MY
show all apps of the developer who made the app: amzn://apps/android?p=com.amazon.mp3&showAll=1 or http://www.amazon.com/gp/mas/dl/android?p=com.amazon.mp3&showAll=1
回答3:
Amazon supports their own deep links now: https://developer.amazon.com/appsandservices/apis/earn/in-app-purchasing/docs/deeplink
E.g. you can start an intent with uri amzn://apps/android?p=my.package.name
.
回答4:
From - https://developer.amazon.com/help/tuabg.html
For in-app advertising or mobile browser based linking, please: Use this link structure: http:// www.amazon.com/gp/mas/dl/android?p=com.example.package/ref=mas_pm_app_name
For a link that directs to a list of all of your apps within our U.S. store, please: Use this link structure: http://www.amazon.com/gp/mas/dl/android?p=com.example.package&showAll=1
Now, you think amazon would have this correct on their own website, but the first part that I put in bold is wrong. This is what it should actually be:
http://www.amazon.com/gp/mas/dl/android?p=com.example.package&ref=mas_pm_app_name
Notice the & instead of the / between the package name and ref. Hopefully this helps some other people since this little detail wasted some of my time...
回答5:
Here's the solution I came up with using the advice below from chiuki:
I added a boolean to one of my resource files that indicates whether or not the app is published in the Amazon AppStore or Android Market. Yeah, you have to change it whenever you publish your app, but think of it sort of like remembering to set debuggable to "false" when you publish. Put it on a check list. It goes like this:
In resource file:
<bool name="app_is_in_amazon_app_store">true< /bool>
In code:
public class SomeUtil
{
private static Boolean isInAmazonAppStore;
public static boolean isInAmazonAppStore(Activity activity)
{
if (isInAmazonAppStore == null)
{
isInAmazonAppStore = activity.getResources().getBoolean(R.bool.app_is_in_amazon_app_store) ;
}
return isInAmazonAppStore;
}
public static void startOtherMarketAppsActivity(Activity activity)
{
try
{
Intent otherApps = null;
if (isInAmazonAppStore(activity))
{
otherApps = new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=" + getPackageNameInAmazonAppStore(activity) + "&showAll=1"));
}
else
{
otherApps = new Intent(Intent.ACTION_VIEW,Uri.parse("market://search?q=pub:\"" + getAndroidDeveloperName(activity) + "\""));
}
activity.startActivity(otherApps);
}
catch(Exception ex){ /* error handling */}
}
来源:https://stackoverflow.com/questions/8235581/how-can-i-do-an-amazon-app-store-search-using-an-intent-and-filter-it-by-develop