I'm using a PHP script to access data in my database.
However, data transfer might be expensive if your plan doesn't cover 3G access. So if there's no Wifi around, it would be good to know, how much my application is actually downloading/uploading/using.
Is there a way I can determine how much Bytes I'm uploading (post arguments) and then downloading (string output/response of the php script)?
Code in use:
//http post
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
httppost.setEntity(new UrlEncodedFormEntity(arguments));
HttpResponse httpresponse = httpclient.execute(httppost);
HttpEntity entity = httpresponse.getEntity();
is = entity.getContent();
Log.e("log_tag", "connection success ");
} catch(Exception e) {
Log.e("log_tag", "Error in http connection "+e.toString());
}