【问题标题】:Force a Soundcloud track to open in Soundcloud app on Android强制在 Android 上的 Soundcloud 应用中打开 Soundcloud 曲目
【发布时间】:2013-10-22 09:28:06
【问题描述】:

我有一个链接到 Soundcloud 轨道的移动应用程序。在 Android 上,点击这些链接会弹出一个对话框,要求用户“使用”他们的浏览器或 Soundcloud 应用程序“完成操作”。

有没有办法绕过这个屏幕,直接在 Soundcloud 播放器中播放曲目?

这是我目前使用的代码。请提出任何修改或新的方法来做到这一点。

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

【问题讨论】:

    标签: android soundcloud


    【解决方案1】:

    最后我自己找到了解决方案。好像没有人知道这件事。 使用下面的代码sn-p,你可以在你的Android应用中默认打开声音云播放器。

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

    重要提示:您必须在您的安卓设备上安装声音云播放器。

    更新

    Soundcloud 社区强烈建议使用sounds 而不是tracks

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

    【讨论】:

      【解决方案2】:

      方案 soundcloud://tracks 不适用于某些 android 设备。来自 soundcloud 社区的他们强烈建议使用 sounds 而不是 tracks

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

      【讨论】:

        【解决方案3】:

        同样适用于用户:

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-11-30
          • 2013-03-21
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多