RestAdapter (retrofit) not resolving in android

前端 未结 4 1573
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 04:39

So I am trying to use Retrofit for my project. As the site says I have included compile \'com.squareup.retrofit:retrofit:2.0.0-beta1\' in build.gradle

4条回答
  •  醉话见心
    2020-12-03 05:15

    There is a change in the API in version 2. This is how you do it in this version:

    Retrofit retrofit = new Retrofit.Builder()
        .baseUrl("https://api.github.com")
        .build();
    
    GitHubService service = retrofit.create(GitHubService.class);
    

    Please refer here for more information: Retrofit 2 home page

    and these slides: Retrofit 2 presentation

提交回复
热议问题