If you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request. You might also need rules for OkHttp and Okio which are dependencies of this library. ProGuard users must manually add the options from retrofit2.pro. If you are using R8 the shrinking and obfuscation rules are included automatically. Retrofit requires at minimum Java 8+ or Android API 21+. Implementation '2:retrofit: (insert latest version)' The source code to the Retrofit, its samples, and this website is available on GitHub. Create a class that extends the Converter.Factory class and pass in an instance when building your adapter. YAML, txt, custom format) or you wish to use a different library to implement an existing format, you can easily create your own converter. If you need to communicate with an API that uses a content-format that Retrofit does not support out of the box (e.g. GitHubService service = retrofit.create(GitHubService.class) Custom Converters addConverterFactory(GsonConverterFactory.create()) Retrofit retrofit = new Retrofit.Builder() Here's an example of using the GsonConverterFactory class to generate an implementation of the GitHubService interface which uses Gson for its deserialization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |