I am downloading a zip file from the internet, save it to the sd card, and unzip the file. My app reads the file line by line, where each line contains 96 column items. I add all items to Contentvalues, which inserts the values to a database.
I have done all these things in services and I’m starting this service in the onCreate method of my splash screen. But this service is not allowing the splash screen to start, it’s taking too much time to populate the database.
Is there any way to do this in the background, without affecting the response of the UI?
Yes you can start service in a separate thread or the whole process you are doing in service can be shifted to thread in service this will also help you in escaping from ANR problems.
obviously you can also use AsynkTask as mentioned in above example