Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Retrofit

Cách sử dụng @path và @query trong Retrofit

Consider this is the url: www.app.net/api/searchtypes/862189/filters?Type=6&SearchText=School Now this is the call: @GET ( "/api/searchtypes/{Id}/filters" ) Call < FilterResponse > getFilterList ( @Path ( "Id" ) long customerId , @Query ( "Type" ) String responseType , @Query ( "SearchText" ) String searchText ); So we have: www . app . net / api / searchtypes /{ Path }/ filters ? Type ={ Query }& SearchText ={ Query }

Working with MVP and Retrofit 2.0 in Android

https://medium.com/@shri_chaudhari/working-with-mvp-and-retrofit-2-0-in-android-4016253ab3fc Recently I have observed that many Android developers are talking about the app architecture, usage of new libraries in the project. So I was thinking why not create a post which will cover some of the topics, so I have decided to go with MVP along with Retrofit 2.0. This post is what I have researched and learnt from various resources. You can even find an example for the same in this blog. I believe that many of you are already aware of MVP and Retrofit, so without going into much details, I will give short descriptions and then start with the example. MVP (Model-View-Presenter) The MVP stands for Model View Presenter. In this architecture, each layer is defined to do certain tasks. Fig 1. MVP Architecture Model  is responsible for handling all business logic, communication with backend server and database operations. The  View  is responsible for dis...