How can I do an Amazon App Store search using an Intent and filter it by developer name?

拥有回忆 提交于 2019-11-30 15:43:06
chiuki

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=

Best way is to look at their website (or here), which currently states this :

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.

JoeLaws

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...

metaphyze

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 */} 
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!