All Projects → pdvrieze → Android Coroutines

pdvrieze / Android Coroutines

Licence: apache-2.0
Additional coroutine support for Android

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Android Coroutines

Korge
KorGE Game Engine. Multiplatform Kotlin Game Engine
Stars: ✭ 780 (+642.86%)
Mutual labels:  kotlin-coroutines
Permissionsflow
A simple library to make it easy requesting permissions in Android using Kotlin Coroutines.
Stars: ✭ 49 (-53.33%)
Mutual labels:  kotlin-coroutines
Kuroba Experimental
Free and open source image board browser
Stars: ✭ 76 (-27.62%)
Mutual labels:  kotlin-coroutines
Peopleinspace
Minimal Kotlin Multiplatform project using Jetpack Compose and SwiftUI
Stars: ✭ 887 (+744.76%)
Mutual labels:  kotlin-coroutines
Eyepetizer
🔥基于 Kotlin 语言仿写「开眼 Eyepetizer」的一个短视频 Android 客户端项目,采用 Jetpack + 协程实现的 MVVM 架构。
Stars: ✭ 988 (+840.95%)
Mutual labels:  kotlin-coroutines
Easychatandroidclient
EasyChat是一个开源的社交类的App。主要包含消息、好友、群组等相关的IM核心功能。部分界面参照了QQ、微信等相关社交APP。EasyChat APP整体采用MVVM模式,基于JetPack(Lifecycle,LiveData,ViewModel,Room)构建
Stars: ✭ 64 (-39.05%)
Mutual labels:  kotlin-coroutines
Kotlinmultiplatform
Kotlin MultiPlatform App (Android, iOS, JVM & JS). MVVM/MVP - Kotlin MultiPlatform
Stars: ✭ 661 (+529.52%)
Mutual labels:  kotlin-coroutines
Covid 19 Tracker
Android app to track COVID-19 cases in India and globally.
Stars: ✭ 96 (-8.57%)
Mutual labels:  kotlin-coroutines
Posts Mvvm Daggerhilt Dynamic Feature Rxjava3 Flow Sample
Posts Api sample with Kotlin RxJava3/Coroutines Flow, Clean Architecture, Offline first/last with Room + Retrofit2, Dagger Hilt, Dynamic Feature Modules, Static Code Analysis, Gradle DSL, MockK+ MockWebServer with Test Driven Development including Api and Database tests
Stars: ✭ 41 (-60.95%)
Mutual labels:  kotlin-coroutines
Kotlin Coroutines Android
Useful extensions for coroutines. AutoDispose + MainScope
Stars: ✭ 77 (-26.67%)
Mutual labels:  kotlin-coroutines
Myweatherkotlinflow
Android app that shows weather at your current location or any custom location you specify. Uses Kotlin Flow for data streaming and coroutines for asynchronous work. Also leverages Room, navigation component, Viewmodel and Livedata Jetpack components with MVVM presentation layer architecture. Dagger 2 with Dagger android for dependency injection
Stars: ✭ 23 (-78.1%)
Mutual labels:  kotlin-coroutines
Ktx
LibKTX: Kotlin extensions for LibGDX games and applications
Stars: ✭ 913 (+769.52%)
Mutual labels:  kotlin-coroutines
Comicreaderapp mvi coroutine rxkotlin jetpack
⚡️Comic reader app 📘. Learning MVVM / MVI with 🌀 RxKotlin, Retrofit, Kotlin Coroutine, Work Manager, Room, Firebase, AndroidX Startup, Clean Architecture ... ❄️
Stars: ✭ 67 (-36.19%)
Mutual labels:  kotlin-coroutines
Kotlin Coroutines Retrofit
Kotlin Coroutines await() extension for Retrofit Call
Stars: ✭ 812 (+673.33%)
Mutual labels:  kotlin-coroutines
Asynkio
Write your asynchronous Network / IO call painlessly in Kotlin !!
Stars: ✭ 82 (-21.9%)
Mutual labels:  kotlin-coroutines
Coil
Image loading for Android backed by Kotlin Coroutines.
Stars: ✭ 7,469 (+7013.33%)
Mutual labels:  kotlin-coroutines
Multiplatform
Kotlin Multiplatform(Android/iOS) project.
Stars: ✭ 50 (-52.38%)
Mutual labels:  kotlin-coroutines
Gligar
📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera.
Stars: ✭ 96 (-8.57%)
Mutual labels:  kotlin-coroutines
Kotlintutorial
Learn Kotlin programming from scratch
Stars: ✭ 88 (-16.19%)
Mutual labels:  kotlin-coroutines
Paperplane
📚 PaperPlane - An Android reading app, including articles from Zhihu Daily, Guokr Handpick and Douban Moment.
Stars: ✭ 1,147 (+992.38%)
Mutual labels:  kotlin-coroutines

This library works, but it's API is not yet stable. It was developed as proof of concept, the best API (esp names) was not a core consideration.

android-coroutines Download GitHub license

While Android is powerful it's activity model suffers from callback hell. Kotlin coroutines are supposed to fix this, but Android is special. Your code can be kicked out of memory at any moment so serialization interferes with coroutines. Getting events back to the coroutine depends on your activity (actually we can use fragments instead - fragments can be difficult, but great here)

API documentation

Core features

The system supports (using Kryo) serialization of coroutines and other functions. It knows about Kotlin and Android and will handle (accidental or convenience) capture of Context and Kotlin objects. It doesn't yet support all Android state, in particular Fragment and View objects (which would need to be looked up through the context).

Help wanted

This is a side-effect of my main (academic work). Any help people want to provide is more than welcome. In particular, the following help is more than welcome.

  • Documentation
  • Example code
  • More features
  • Feedback on design and API
  • Test feedback
  • Support presence of Fragments and Views in the capture context (referring back to the activity to) resolve them.

Currently supported functionality

startActivityForResult

In your activity you can use a coroutine to just get the result of invoking another one:

fun onButtonClick(v:View) {
    launch {
       activityResult(Intent(MyDelegateActivity::class.java)).onOk { resultIntent ->
          runOnUiThread { textView.text = newText }
       }
    }
}

There are some variations of this, and the Maybe implementation used has many options.

SuspendableDialog

In many cases you have a dialog to get some input from the user. From yes-no questions to input of values. SuspendableDialog is a subclass of DialogFragment that provides the building blocks to have a dialog that is used in a coroutine. The actual dialog implementation just has to invoke dispatchResult with the appropriate result value and the dialog is handled. Dismissal or cancellation are handled by default.

DownloadManager

Warning - not quite complete

Using the download manager is not quite straightforward even though you get a lot for free. The DownloadFragment.download(Activity, Uri) function will download your file and resume your coroutine when complette.

TODO(DownloadManager)

  • Handle download completion when the activity/fragment is not visible (on resume check the status and invoke the continuation as appropriate)

AccountManager

AccountManager is not pretty, but this class makes it a bit prettier. In particular it implements a suspending wrapper around getAuthToken that will even invoke a permission intent if needed (as was possible before Kitkat, but will no longer work).

TODO(AccountManager)

  • Implement extension functions for all the client-side API of AccountManager.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].