I'm looking for the best practise, for making background updater. I have this sequence of activities
SplashScreen -> LoginScreen -> MainActivity
What i need is to perform update before MainActivity has started. I'm using volley lib for download. I want Activity/Singleton/Service/Something else, which starts simultaneously with SplashScreen. And start of MainActivity have to wait until the background Updater has finished. I want to
Updater object behavior: Check version, if newer version exists, download archive with sources. Try apply changes (parsing xml and lots of things that should crash). Apply changes. Start app.
My thoughts: 1) Make updater an Activity: But i want to download o lots of bits and 5 seconds of splashscreen wait should slow down this process. As i know, background activity doesn't exist. (Yeah, it does, and its called service...) 2) Make them an Service: I never used service, so i'm not sure it's the best way. After update there is 24 hours off timer. Is even possible to start Activity from service? 3) Singleton (static class, or something, what is not activity, nor service): As service, but there should be problem with acces options that needs context to it's running. If i get it, change context from Splashscreen to loginscreen shloud be the problem. 4) AsyncTaks: As previous, how to wait until asynctaks is done to start activity?
Did i miss something? Is some practise which fits my problem?
Can anyone give me some example of classes and their connection to each other, which would be the best solution of this problem?