I want my app to open spotify links and send people to the app. If the app is installed, this works wonders:
final Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("spotify:album:7rt7AxYexFTtdEqaJPekvX"));
However, there will be cases where the app is not installed yet, so I'll want them to download it from Google Play with this other intent:
final Intent intent = new Intent(
Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/store/apps/details?id=com.spotify.mobile.android.ui"));
However, I really want it to be installed directly from Google Play instead of letting people to choose which app to open... if Google Play is installed. If Google Play is missing, I want them to choose which app to open (often it will be a navigator, but whatever)
Is there a way to do this?
However, I really want it to be installed directly from Google Play instead of letting people to choose which app to open
Use the market://
Uri
instead of the https://
Uri
: http://developer.android.com/distribute/googleplay/promote/linking.html
Also, please only use the spotify:
scheme if that is publicly documented and supported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With