Android Application Architecture - Separating Code and Database Layers
I am writing an Android application that does the following:
- Get data from the server.
- Save the data to the database.
- Refresh views with data from the database.
In my previous applications, I used to write service calls using Ion and then make a DB call using ORMLite and update the views. All the code was in the corresponding Activity or fragment.
The result is a lot of repetitive and redundant code.
You can recommend how to separate these layers.
thank
PS: I have ideas on how to do this, but it requires going around the context and increasing the complexity of the callbacks.
+3
source to share