// file upload failed so abort post and close connection
post.abort();
client.getConnectionManager().shutdown();
// get user preferences and number of retries for failed upload
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( context );
int maxRetries = Integer.valueOf( prefs.getString( "retries", "" ).substring( 1 ) );
// check if we can connect to internet and if we still have any tries left
// to try upload again
if( CheckInternet.getInstance().canConnect( context, prefs ) && retries < maxRetries ) {
// remove notification for failed upload and queue item again