Q:

Android: Update horizontal progess dialog when creating large database with dbhelper

I have been searching for this for days.   I have a very large database which is loaded from an SQL file.   The code for this is in the DbHelper class file and so, as I create an instance of the helper, if the database does not exist the creation takes place. 
I have a progress spinner showing but I would like to be able to show a progress bar which increments as the file is created. 
Most examples show how to do this but not how to send a value from the helper back to the main activity. 
The helper is called from a thread in main.   Any help would be greatly appreciated

A:

This is something that an AsyncTask does very well. 
 When you invoke the publishProgress method from inside doInBackground, the onProgressUpdate method gets called on the UI thread and you can update your progress bar from there. 
Here's a couple of good examples: 
http://labs.makemachine.net/2010/05/android-asynctask-example/
https://sites.google.com/site/androidhowto/how-to-1/create-a-custom-progress-bar-using-asynctask

