android - Best practice for communitcating between modules -
from software engineers view, code should devided in modules. did in project. there classical 3 modules model-view-controller (as known pattern). in controller actions take long time (for example sync of model) , short (changing local model example).
what's best way publish results/changes view via one interface?
in understanding, long actions syncing server should run in seperate thread service. using similar thread manipulating local model waste resource in eyes - since (also in future in case) quick operation.
android has loaders/cursoradapter - works in keeping ui , data loading independently.
you can have thread(volley netowrking lib) sync data , update database - , db(contentprovider) notify "observing" cursors update ui.
lookup loaders/cursor adapter , volley.
Comments
Post a Comment