android / sunflower

A gardening app illustrating Android development best practices with migrating a View-based app to Jetpack Compose.
https://d.android.com/jetpack
Apache License 2.0
17.63k stars 4.69k forks source link

Can add Firestore to the Repository? #308

Open ashrafi opened 5 years ago

ashrafi commented 5 years ago

We need a good example of how Jetpack should be designed for both online and offline. The Repository should get all the info from Firestore and update the Room DB with LiveData.

Writing a robust offline Repository would be a good addition to this example

ashraf-patel commented 4 years ago

Good point,

I am not sure how convenient it is, but I agree that it's gonna be helpful for sure.

After adding some sort of network interaction in the app, ViewModels will also have error handling for that along with getting the data from multiple source based on the conditions. Which means we will have some logic in ViewModel to unit test. Right now viewmodels don't have much logic in them.