A Kotlin Multiplatform project that creates an Http client library around the Rick and Morty API.
The Rick and Morty API client supports both Android & iOS and can be added to the common main dependencies. Replace $version
with the latest version:
buildScript {
repositories {
mavenCentral()
}
}
commonMain {
dependencies {
implementation("com.plusmobileapps:rick-and-morty-api:$version")
}
}
The API client itself can be accessed through RickAndMortyApi.instance
where all of the following methods can be used.
// in a coroutine
val characters = RickAndMortyApi.instance.getCharacters(page = 1)
You can run the Android app itself from Android Studio or run the following command from the terminal to build and install on an Android device that is running.
./gradlew :sample:androidApp:installDebug
Open the sample/iosApp/iosApp.xcworkspace
file or run the following command to open the iOS project.
cd sample/iosApp/
pod install
xed .
- Coroutines - async
- Ktor - http client
- kotlinx.serialization - JSON serialization
- Decompose - navigation and lifecycle
- MVIKotlin - presentation and business logic
- SQLDelight - data storage
- Multiplatform settings - save simple key value data