Force a Soundcloud track to open in Soundcloud app on Android

前端 未结 3 1932
孤街浪徒
孤街浪徒 2021-01-01 07:37

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

相关标签:
3条回答
  • 2021-01-01 07:58

    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);
    
    0 讨论(0)
  • 2021-01-01 08:03

    The same works with users:

    String id = "123395690"; //Userid
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("soundcloud://users:" + id));
    startActivity(intent);
    
    0 讨论(0)
  • 2021-01-01 08:08

    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);
    
    0 讨论(0)
提交回复
热议问题