如何在 Java 中使用 SoundCloud API(Android 应用程序)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26112014/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 09:18:57  来源:igfitidea点击:

How to use SoundCloud API in Java (Android App)

javaandroidapisoundcloud

提问by Dan

I am researching for a project and was wondering if I can use SoundCloud API for making and app that streams music with SoundCloud. I could not find any official source from SoundCloud to privde a Java solution.

我正在研究一个项目,想知道是否可以使用 SoundCloud API 来制作和使用 SoundCloud 流式传输音乐的应用程序。我找不到来自 SoundCloud 的任何官方资源来提供 Java 解决方案。

Any idea?

任何的想法?

回答by Dhinakaran Thennarasu

Go to Soundcloud developer site

前往 Soundcloud 开发者网站

Click on My Apps.. Sign in Register your new app Once you register you will have client id and client secret. Note it

单击我的应用程序... 登录 注册您的新应用程序 注册后,您将拥有客户端 ID 和客户端密码。请注意

https://api.soundcloud.com/tracks/"TRACK ID"/stream?client_id="YOUR CLIENT ID"

https://api.soundcloud.com/tracks/"TRACK ID"/stream?client_id="您的客户 ID"

This API url will give you the sound file you want to play. You can use this url and parse the track id to play according to your need.

这个 API url 会给你你想要播放的声音文件。您可以使用此 url 并根据需要解析曲目 ID 进行播放。

You can play around the url with different stuffs like getting user details,playlists.

您可以使用不同的内容来处理 url,例如获取用户详细信息、播放列表。

Refer this link for more API reference

请参阅此链接以获取更多 API 参考

回答by chemalarrea

I update a library for new versions of android: https://github.com/chemalarrea/soundcloudapi-android

我为新版本的 android 更新了一个库:https: //github.com/chemalarrea/soundcloudapi-android

回答by nullbyte

I know it's too late, but in case if somebody else is stuck.

我知道为时已晚,但以防万一其他人被卡住了。

You can check out this repository. It's a simple wrapper of the SoundCloud API built with Retrofit2 and RxJava.

您可以查看此存储库。它是使用 Retrofit2 和 RxJava 构建的 SoundCloud API 的简单包装器。