Android Open Source - ponyville-live-android A P I

From Project

Back to project page ponyville-live-android.


The source code is released under:

Apache License

If you think the Android project ponyville-live-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*from w ww.j  a v a 2s  .  co m*/

import retrofit.RestAdapter;
import retrofit.client.Client;
import retrofit.client.OkClient;
import retrofit.converter.Converter;
import retrofit.converter.GsonConverter;
import retrofit.http.GET;
import retrofit.http.Path;
import rx.Observable;

 * <p>The code contract for the Ponyville Live! API as documented on
 * <a href="">Apiary</a></p>
public interface API {

    public Observable<MapResponse<String, NowPlayingMeta>> getNowPlaying();

    public Observable<ObjectResponse<NowPlayingMeta>> getNowPlayingForStation(@Path("id")int id);

    public Observable<ArrayResponse<Station>> getStationList();

    public Observable<ArrayResponse<Station>> getStationList(@Path("category")String category);

    public Observable<ArrayResponse<Show>> getShows();

    public Observable<ArrayResponse<Show>> getAllShows();

    public Observable<ObjectResponse<Show>> getEpisodesForShow(@Path("id")String id);

     * <p>A builder class for {@link}. A default builder will use
     * as the API host</p>
    public static class Builder {
        private String hostUrl;
        private Client client;
        private Converter converter;
        private RestAdapter.LogLevel logLevel;

        public Builder setHostUrl(String hostUrl) {
            this.hostUrl = hostUrl;
            return this;

        public Builder setClient(Client client) {
            this.client = client;
            return this;

        public Builder setConverter(Converter converter) {
            this.converter = converter;
            return this;

        public Builder setLogLevel(RestAdapter.LogLevel logLevel) {
            this.logLevel = logLevel;
            return this;

        public API build() {
            if(hostUrl == null) hostUrl = "";
            if(client == null) client = new OkClient();
            if(converter == null) converter = new GsonConverter(new Gson());
            if(logLevel == null) logLevel = RestAdapter.LogLevel.NONE;

            return new RestAdapter.Builder()


Java Source Code List