This is a basic example for setting up Koin with Retrofit 2.6.0. This example also includes error handling and testing.
I've written a 4 part Medium series to go with the example code.
This set of examples builds up to many parts, check them out too:
- Part 1. Setting up Koin 2.0.1 for Android -- branch: setting-up
- Part 2. Retrofit 2.6.0 with Koin and coroutines -- branch: setting-up
- Part 3. Retrofit 2.6.0 with Koin and coroutines: network error handling -- branch: error-handling
- Part 4. Retrofit 2.6.0 with Koin and coroutines: testing the ViewModel and Repository -- branch: testing
Clone and add your OpenweatherMaps API key to gradle.properties.