I upload photo to the server via the default HttpClient in Android SDK. I want to show progress in the user interface, is there a way to find out how much has been uploaded?
Or you should use AsyncTask to do the actual process of file upload and use ProcessDialog to start and stop the process.
You can see this code, http://github.com/narup/mymobile/blob/master/pbdroid/src/com/example/android/skeletonapp/StoreListActivity.java i wrote to load the JSON data over HTTP and i use process dialog.
Main part of the code is :
private class LoadStoresTask extends AsyncTask> {
@Override
protected List doInBackground(String... params) {
return WsiStoresClient.connect(params[0]);
}
@Override
protected void onPostExecute(List result) {
dismissDialog(BUSY_DIALOG_KEY);
}
}