WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Amir-yazdanmanesh
Copy link


Issue Reference: Retrofit Kotlin examples #4205

This PR introduces a Kotlin sample that demonstrates how to use Retrofit in conjunction with RxJava to fetch GitHub repositories for a specified user.

  • Added a Kotlin example that fetches repositories from the GitHub API using Retrofit and RxJava.

@kungpaogao
Copy link

kungpaogao commented Oct 9, 2024

+1, this would be nice to have, but could we also use coroutines as well to make it even more Kotlin? (edit: just found this PR #3500)

Also, it would be good to have Kotlin examples on the homepage.

@Amir-yazdanmanesh
Copy link
Author

+1, this would be nice to have, but could we also use coroutines as well to make it even more Kotlin? (edit: just found this PR #3500)

Also, it would be good to have Kotlin examples on the homepage.

While using coroutines would indeed make the implementation more idiomatic to Kotlin, I decided to go with the current libraries in the module to avoid introducing new dependencies. Adding a new library to a project like Retrofit requires the owner's permission, and in this case, I wanted to demonstrate how we can work within the existing setup, using RxJava, which is already integrated. This keeps the implementation aligned with the current project dependencies while still showcasing Kotlin features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants