2

I have a mobile application that links to Soundcloud track. On Android, clicking on those links brings up a dialog asking the user to "Complete action using" their browser or the Soundcloud app.

enter image description here

Is there a way to bypass this screen and just play the track in the Soundcloud player?

This is the code I currently using. Please suggest any modifications or new way to do this.

    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.soundcloud.com/blackburnravers/dj-nj-house-music-volume-3"));
    startActivity(intent);
enadun
  • 3,107
  • 3
  • 31
  • 34

3 Answers3

9

Finally I found the solution by myself. Seems like nobody knows about this. By using the following code snippet, you can open the sound cloud player by default from your Android app.

String id = "114143409"; //Track id
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("soundcloud://tracks:" + id));
startActivity(intent);

Important : You have to have install the sound cloud player on your android device.

Update

Soundcloud community is strictly recommending to use sounds instead of tracks

String id = "114143409"; //Track id
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("soundcloud://sounds:" + id));
startActivity(intent);
enadun
  • 3,107
  • 3
  • 31
  • 34
2

Scheme soundcloud://tracks is not working some android devices. As from soundcloud community they strictly recommend using sounds instead of tracks

String id = "yOUR_id"; //Track id
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("soundcloud://sounds:" + id));
startActivity(intent);
Jackson Chengalai
  • 3,907
  • 1
  • 24
  • 39
1

The same works with users:

String id = "123395690"; //Userid
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("soundcloud://users:" + id));
startActivity(intent);
Bram Klein
  • 21
  • 1