8000 GitHub - akhilesh0707/CoroutineExample: Coroutine examples of image downloading and processing, network calls, room DB, AsyncronousFlow
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

akhilesh0707/CoroutineExample

Repository files navigation

Coroutine Example

Akhilesh StackOverflow Akhilesh LinkedIn

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

  1. Image download and image proccessing

  1. Retrofit call to show list of countries using coroutines

  1. Room database CRUD operation with coroutines

  1. 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)
    }
}
  1. Coroutines flow example with retrofit and MVVM

Tech Stack

  • 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

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

  1. Download/clone zip
  2. Extract the downloaded Zip
  3. Start android Studio, Close any existing project and navigate through import existing android project.

Prerequisites

Working Java instalation and Android Studio for devlopment.

Built With

Authors

About

Coroutine examples of image downloading and processing, network calls, room DB, AsyncronousFlow

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0