mardi 3 mai 2016

Service writing to a database and activity reads from it

Architecture help needed. I'm building an app which will consist from Service and Activity. Service will write data to SQLite DB and Activity should read it and display. There are two problems: 1) Activity should receive updates on-the-fly. 2) If Activity goes background it should load all the changes when it returns foreground.

After two days of research I assume that the only way to implement it is creating ContentProvider as the middle layer and using CursorLoader in Activity. Am I right? Any other suggestions? Any help would be appreciated. Thank you.

Aucun commentaire:

Enregistrer un commentaire