You can set the max of the progress bar to 15secs*5 = 75 to enable updating smaller 'bites' for a smoother animation.
Then update progress by 1 each 200ms.
progressBar.setMax(75)
while (progressStatus < 75) {
progressStatus += 1;
// Update the progress bar and display the
//current value in the text view
handler.post(new Runnable() {
public void run() {
progressBar.setProgress(progressStatus);
textView.setText(progressStatus+"/"+progressBar.getMax());
}
});
try {
// Sleep for 200 milliseconds.
//Just to display the progress slowly
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Could also sleep only 100ms using a max of 150.