1

I've built a Tizen/Samsung smartwatch companion app for an Android app. Inside the Android app, I can detect if a Samsung/Tizen watch is paired to the Android phone, but missing the smartwatch companion app.

I am prompting the user to install the smartwatch companion app if they don't have it. However, I'd like to make it very easy for the user to get the companion app, by providing a button for them to click that will open the Galaxy Store straight to the smartwatch companion app download page.

Is there an intent for opening the Galaxy Store to a specific app page on an Android phone?

I've tried this based on other answers on SO:

val intent = Intent(Intent.ACTION_VIEW, Uri.parse("samsungapps://ProductDetail/com.sec.android.app.samsungapps"))
startActivity(intent)

That crashes with:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=samsungapps://ProductDetail/com.sec.android.app.samsungapps }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2058)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1716)
    at android.app.Activity.startActivityForResult(Activity.java:5211)
    at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:675)
    at android.app.Activity.startActivityForResult(Activity.java:5169)
    at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:662)
    at android.app.Activity.startActivity(Activity.java:5540)
    at android.app.Activity.startActivity(Activity.java:5508)

Note: I need a solution that works on ALL Android phones with the Galaxy Store, not just Samsung phones.

DiscDev
  • 38,652
  • 20
  • 117
  • 133

1 Answers1

1

It's other way around. As I've explained here, you need to add the following tag to config.xml of your watch app to auto-install the companion app on Android from Play Store.

<metadata key="master_app_playstore_deeplink" value="market://details?id={package_id}"/>

If you distribute your Android app through Samsung's Galaxy App Store, then you would need to use "samsungapps://" scheme.

Android system doesn't know anything about either scheme and that's why you're getting that exception and that's why using these schemes in the Android's Intent won't work.

If there is other way of doing what you want, I don't know - you'll need to research. There could be something in Android's SAP libraries provided by Samsung.

Oleg Gryb
  • 5,122
  • 1
  • 28
  • 40
  • I didn't specify, but I built my Tizen app using .NET. I'm unable to find any documentation that states master_app_playstore_deeplink works in .NET apps. If it does though, it would go in the tizen-manifest.xml file, not config.xml, as config.xml doesn't exist for .NET Tizen apps. – DiscDev Aug 13 '20 at 17:38
  • I'm marking this as the accepted answer for now. TL;DR it's not possible right now to open the Galaxy Store via an Intent inside an Android app, but it IS possible to open the Play Store on an Android phone if the user installs the Tizen Watch app but doesn't have the Android app to which the Tizen app is a companion. This situation is very backwards (at least for us) since our Android app is very popular, but it may help 1 or 2 people get the correct Android app. – DiscDev Aug 21 '20 at 15:03
  • @DiscDev there are many shortcomings in both Android and Tizen platforms. We just need to adjust and try not to get frustrated much. I should admit that it's not always easy – Oleg Gryb Aug 22 '20 at 00:10
  • At this point, I've built native mobile apps for iOS, Android, WearOS, Apple Watch, and Tizen. The documentation, tooling, IDEs, emulators, app approval process, etc. for Tizen is the worst of all 5. The Tizen hardware is great! The developer experience needs drastic improvement. It's no wonder that Tizen has so few apps available. Make it better for developers and we'll build good apps. – DiscDev Sep 02 '20 at 22:06