Giter Site home page Giter Site logo

rifqimfahmi / android-mvvm-coroutine Goto Github PK

View Code? Open in Web Editor NEW
142.0 7.0 39.0 303 KB

Kotlin android application example with MVVM pattern, android architecture, kotlin coroutine, unit test, and UI test

License: MIT License

Kotlin 100.00%
android-architecture kotlin-coroutine mvvm-pattern android-mvvm-coroutine viewmodel coroutines room livedata kotlin-android-application android-cleanarchitecture

android-mvvm-coroutine's Introduction

android-mvvm-coroutine

Kotlin android application example with MVVM pattern, android architecture components, and kotlin coroutine.This sample is about soccer match schedules which the API i used from theSportDb. You can read the article that I write to talk about this sample app. This sample app is based on the Guide to app architecture article with the androidx package, Kotlin 1.3, and production ready coroutine. I use several android architecture components like LiveData, ViewModel ,Room. Here are several libraries that i use:

The architecture overview:

Guide to app architecture

There are several external sample i take to create this sample, primarily from this google Github Browser Sample app. For this app i use the NetworkBoundResource for common implementation to fetch and cache resource from the internet. It also have abstract functions such as whether we should fetch data from internet or not. If the device is offline, the repository will return the last cached data. Almost all data returned from the repository that fetched from the network is wrapped in a Resource object to determine the data status whether it is loading, success, or error.

Try the app at Play Store. Feel free to create new issues for bug or request more features.

android-mvvm-coroutine's People

Contributors

rifqimfahmi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-mvvm-coroutine's Issues

can we put more data like this

val result: LiveData<Resource<List>> = Transformations.switchMap(query) { q,t ->
if (q.isNullOrEmpty()) {
AbsentLiveData.create()
} else {
sportRepository.searchTeam(q)
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.