I am making an app which gets a time schedule from a website and display it in my app in a nice ListView. To make the schedule available when the user is offline I am trying to save it in a SQLite database first and get the data from there. The idea is that the database gets updated when the user starts the app, when the user presses a refresh button and at set times by a service running in the background.
My question is: how can I efficiently update and get data from the database without using the UI thread, thus not blocking user interaction.
I think I should use a system which puts tasks in a queue so that the database gets updated before the data gets displayed in my ListView. Other than this I don't have a single clue how to realise such a system on Android.