Thanks to visit codestin.com
Credit goes to github.com

Skip to content

febaisi/ListenableWorkerExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ListenableWorkerExample

Simple project using ListenableWorkers with Kotlin.

Google provides good documentation for it - but it's always helpful to have an example to follow. I had a couple of issues to find a piece of code to follow for the ListenableWorker implementation with Kotlin, which should be widely used since this is the right way to retrieve Locations using WorkManager.

Even though it's a simple project I tried to use the MVVM pattern, so it also covers a little bit of:

  • Basic kodein -> Kotlin dependency injection
  • ModelViews
  • ViewModelProviders
  • LiveData
  • LiveData Transformations - (Map and SwitchMap)
  • Repository (In a fake way)
  • Location Permission (Including new Android 10 - Background location)

The location data is being requested by a OneTimeWorkRequest object and handled using ListenableWork. The results are displayed on the Activity through liveData (MVVM).

ListenableWorker

About

ListenableWorkerExample

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages