Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我可以将SoundCloudAPI与外部url一起使用吗?_Android_Url_Streaming_Soundcloud_Radio - Fatal编程技术网

Android 我可以将SoundCloudAPI与外部url一起使用吗?

Android 我可以将SoundCloudAPI与外部url一起使用吗?,android,url,streaming,soundcloud,radio,Android,Url,Streaming,Soundcloud,Radio,我想使用外部无线电url。但是当我尝试配置我的配置类时,我没有得到一个好的结果 例如: 原始配置工作: public interface SCService { @GET("/tracks?client_id=" + Config.CLIENT_ID) public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb); } @GE

我想使用外部无线电url。但是当我尝试配置我的配置类时,我没有得到一个好的结果

例如:

原始配置工作:

public interface SCService {

    @GET("/tracks?client_id=" + Config.CLIENT_ID)
    public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);

}
@GET("myURL?client_id=" + Config.CLIENT_ID)
    public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);
公共接口服务{
@获取(“/tracks?client_id=“+Config.client_id”)
public void getRecentTracks(@Query(“created_at[from]”)字符串日期,回调cb);
}
我试过了:

public interface SCService {

    @GET("/tracks?client_id=" + Config.CLIENT_ID)
    public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);

}
@GET("myURL?client_id=" + Config.CLIENT_ID)
    public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);
@GET(“myURL?client_id=“+Config.client_id”)
public void getRecentTracks(@Query(“created_at[from]”)字符串日期,回调cb);

我没有使用SoundCloudAPI,我不知道我是否可以使用这个api。我期待有一个Android应用程序来播放流媒体音频url。

您正在使用改型。必须有一个配置类。大概是这样的:

public class Config {
public static final String CLIENT_ID = " Your id";
public static final String API_URL =  "http://api.soundcloud.com/users/channelname/";
}
public interface SCService {

@GET("/tracks?client_id=" + Config.CLIENT_ID)
public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);
因此,您必须具有来自声音云API的客户端id。你可以通过注册他们的服务免费获得一个

然后,在您的服务界面中,您可以这样使用它:

public class Config {
public static final String CLIENT_ID = " Your id";
public static final String API_URL =  "http://api.soundcloud.com/users/channelname/";
}
public interface SCService {

@GET("/tracks?client_id=" + Config.CLIENT_ID)
public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);
公共接口服务{
@获取(“/tracks?client_id=“+Config.client_id”)
public void getRecentTracks(@Query(“created_at[from]”)字符串日期,回调cb);

您正在使用改装。必须有一个配置类。类似以下内容:

public class Config {
public static final String CLIENT_ID = " Your id";
public static final String API_URL =  "http://api.soundcloud.com/users/channelname/";
}
public interface SCService {

@GET("/tracks?client_id=" + Config.CLIENT_ID)
public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);
因此,您必须拥有来自sound cloud API的客户端id。您可以通过免费注册他们的服务获得一个客户端id

然后,在您的服务界面中,您可以这样使用它:

public class Config {
public static final String CLIENT_ID = " Your id";
public static final String API_URL =  "http://api.soundcloud.com/users/channelname/";
}
public interface SCService {

@GET("/tracks?client_id=" + Config.CLIENT_ID)
public void getRecentTracks(@Query("created_at[from]") String date, Callback<List<Track>> cb);
公共接口服务{
@获取(“/tracks?client_id=“+Config.client_id”)
public void getRecentTracks(@Query(“created_at[from]”)字符串日期,回调cb);

更多的上下文(代码行)能帮我们找到答案吗?我不明白,但你删除了封闭的“公共接口SCService{}”块。谢谢。更多的上下文(代码行)能帮我们找到答案吗?我不明白,但你删除了封闭的“公共接口服务{}”"block.谢谢。我是说我有beofre,但我改了。因为我想在我的soundcloud帐户中播放一首曲目!我想像我的Web服务一样使用SounClud来消费此音频。我解释过了吗?我是说我有beofre,但我改了。因为我想在我的soundcloud帐户中播放一首曲目!我想像我的Web服务一样使用SounClud我有没有解释过?