Motivation 未だXMLでレスポンスが返ってくるAPIを使っておりまして、XML parserを頑張って実装していましたがだんだん辛くなってきたので、代替案を調べました せっかくなのでRetrofit2を使おうと思い立ち、レスポンスをXMLに変換するクラスも用意されているとのことだったので、雑ですが使い方をまとめておこうと思います 参考にしたサイト Retrofit2 x SimpleXML https://futurestud.io/blog/retrofit-how-to-integrate-xml-converter なぜretrofit2なのか、ということが書かれている https://realm.io/news/droidcon-jake-wharton-simple-http-retrofit-2/ build.gradleへの記述 converter-simplexm
AddCookiesInterceptor.java 0K:ՋU Г:ՋU /** * This interceptor put all the Cookies in Preferences in the Request. * Your implementation on how to get the Preferences MAY VARY. * <p> * Created by tsuharesu on 4/1/15. */ public class AddCookiesInterceptor implements Interceptor { @Override public Response intercept(Chain chain) throws IOException { Request.Builder builder = chain.request().newBuilder(
Introduction Retrofit turns your HTTP API into a Java interface. public interface GitHubService { @GET("users/{user}/repos") Call<List<Repo>> listRepos(@Path("user") String user); } The Retrofit class generates an implementation of the GitHubService interface. Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.github.com/") .build(); GitHubService service = retrofit.create(GitHubServ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く