janishar / android-mvp-architecture

This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView
https://janisharali.com
Apache License 2.0
4.43k stars 1.24k forks source link

GreenDao and HTTP same time #56

Closed Themesaul closed 6 years ago

Themesaul commented 6 years ago

In the case of wanting to implement custom offline cache with GreenDao, Where should I do in DataManager or in the request in the presenter?

You could say how you would do it, please (no need code, just a short description, for example for getBlogApiCall() )

Another question I have is about the possibility of making multiple requests (single, ex: getBlogApiCall) at a time (when necessary) with zip. Is it a good practice?

Thanks for this repository and for the blog.

amitshekhariitbhu commented 6 years ago

To implement cache, cache it at network layer. Do it with OkHttp network interceptor. And yes zip is a good option to make multiple request if you need response at a same time for the requests.

Themesaul commented 6 years ago

Thank you very much for your answer. I was referring to doing it manually so I could run query with RxJava2 without problems