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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -