android - For background download should i use service? -
i'm developing first android app , created class (not activity) downloads json file , writes content sqlite database @ every start-up of application. use instance of class in main activity class. if download takes few seconds home page of app hangs on blank screen.
do think should use service instead of class handle download , writing of db? idea? if could, advantages?
if writing database recommend using intentservice
the intent service runs in it's own thread.
when download complete can use localbroadcastmanager notify activity. work contentprovider , loaders.
Comments
Post a Comment