Kotlin Coroutine example of Image download, apply filter on image, network calls using retrofit and coroutine, CRUD operation using Room DB and coroutines, Kotlin coroutine flows exmaples
Created multiple branches based on funtionality
- Image download and image proccessing
- Retrofit call to show list of countries using coroutines
- Room database CRUD operation with coroutines
- Asynchronous Flow example create, properties,cancellation, operators, buffering, composing and exception handling
fun main() {
runBlocking {
getPrimeFlow().collect {
println("Receive: $it")
}
}
}
fun getPrimeFlow(): Flow<Int> = flow {
val primeNumList = listOf(2, 3, 5, 7, 11, 13, 19, 23, 29)
primeNumList.forEach {
emit(it)
}
}
- Coroutines flow example with retrofit and MVVM
- Coroutines - Coroutines for asynchronous programming
- Retrofit 2 - OkHttp3 - request/response API
- Glide - For image loading.
- LiveData - use LiveData to see UI update with data changes
- ViewModel - Archtecture
- Room - To store data
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Download/clone zip
- Extract the downloaded Zip
- Start android Studio, Close any existing project and navigate through import existing android project.
Working Java instalation and Android Studio for devlopment.
- Akhilesh Patil - Stackoverflow profile - Stackoverflow profile Linkedin profile - Linkedin profile