Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does 'Samsung Apps' support a URI scheme to redirect to specific apps?

One of my customers is keen on promoting a 'lite' version of his full app on a number of popular Samsung devices. This lite version will be uploaded to http://www.samsungapps.com, and users will then be able to download it through the 'Samsung Apps' app. The lite version features an in-app link to the full app.

Now, I've been searching Samsung's website for any information about a URI scheme that Samsung Apps can pickup and use to directly present the user with the relevant details of the full app. For both Google Play and Amazon you can simply fire off an intent with a specific URI scheme and the app's package name; e.g:

Google Play:

marketIntent.setData(Uri.parse("market://details?id=" + FULL_VERSION_PACKAGE_NAME)); 

Amazon:

marketIntent.setData(Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=" + FULL_VERSION_PACKAGE_NAME)); 

That's all documented and pretty straightforward to find. However, I haven't been able to figure out if Samsung Apps provides its own URI scheme for similar behaviour.

I do release that since we're talking about Android devices here, I could just link to Google Play. It just appears strange to me that Samsung would offer a market-like system without the ability to link to specific products available in there, so I hope I'm overlooking something.

Does anyone have any pointers on this? Note that I do not have a device (compatible) with Samsung Apps to actually test anything.

like image 946
MH. Avatar asked Apr 26 '12 22:04

MH.


2 Answers

So I finally managed to find the answer to my question hidden away in a pdf document. It's titled "Samsung Apps Deeplink Guide" and can be downloaded from Samsung's resource center.

For those not interested in the whole document, which contains some information on how to invoke specific screens in the Samsung Apps app, the answer is straightforward. Attach a URI to the Intent's data with the following format:

samsungapps://ProductDetail/<the package name of the AndroidManifest.xml> 

For example, a direct link to the Samsung Apps app in Samsung Apps (phrasing still makes sense?) would be:

samsungapps://ProductDetail/com.sec.android.app.samsungapps 

So the app indeed supports a URI scheme similar to Google Play and Amazon, as suspected.

Do note that I haven't been able to test this yet, but I did come across a recently raised flag (from April 27, 2012) that apparently this functionality has suddenly stopped working. According to a response to that flag the Samsung devs are looking into it, but I may just hold off on this until a fix has been confirmed.

like image 59
MH. Avatar answered Sep 24 '22 12:09

MH.


I use following code for linking to Google Play, Amazon Appstore and Samsung Galaxy Apps by package name.

public static final String MARKET_GOOGLE_URL = "market://details?id="; public static final String WEB_GOOGLE_URL = "http://play.google.com/store/apps/details?id=";  public static final String MARKET_SAMSUNG_URL = "samsungapps://ProductDetail/"; public static final String WEB_SAMSUNG_URL = "http://www.samsungapps.com/appquery/appDetail.as?appId=";  public static final String MARKET_AMAZON_URL = "amzn://apps/android?p="; public static final String WEB_AMAZON_URL = "http://www.amazon.com/gp/mas/dl/android?p=";  public static void openOnMarket(String market, String web, Context context, String packageName) {      try {         Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(market + packageName));         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         context.startActivity(intent);     } catch (android.content.ActivityNotFoundException anfe) {         Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(web + packageName));         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         context.startActivity(intent);     }  }   public static void openOnGooglePlayMarket(Context context, String packageName) {     openOnMarket(MARKET_GOOGLE_URL, WEB_GOOGLE_URL, context, packageName); }  public static void openOnSamsungMarket(Context context, String packageName) {     openOnMarket(MARKET_SAMSUNG_URL, WEB_SAMSUNG_URL, context, packageName); }  private static void openOnAmazonMarket(Context context, String packageName) {     openOnMarket(MARKET_AMAZON_URL, WEB_AMAZON_URL, context, packageName); } 

It's at first trying to open market application by URI, but if it is not found open web link. I hope this code will be useful to someone.

like image 34
AndreyICE Avatar answered Sep 22 '22 12:09

AndreyICE