I am uploading image to server using base64 its working fine if image is small but if image is big it gives me memory out exception
try {
ByteArrayO
Try this code once.
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 90, bao);
byte[] ba = bao.toByteArray();
String ba1 = Base64.encodeBytes(ba);
ArrayList < NameValuePair > nameValuePairs = new
ArrayList < NameValuePair > ();
nameValuePairs.add(new BasicNameValuePair("image", ba1));
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new
HttpPost("URL STRING");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
//Toast.makeText(SignUpActivity.this, "Joining Failed", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Log.e("log_tag", "Error in http connection " + e.toString());
}
I can help you if you have any doubt.