1.得到一个bitmap
bitmap = data.getParcelableExtra("data");
2.通过base64转化byte[]
ByteArrayOutputStream out = new ByteArrayOutputStream();bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);//转换为PNG格式
out.flush();
out.close();
byte[] buffer = out.toByteArray();
byte[] encode = Base64.encode(buffer, Base64.DEFAULT);
3.将byte[]转换为字符串
String photo = new String(encode);4.传递参数
RequestParams params = new RequestParams();
params.put("ImagefileName", fileName);
params.put("filestream", photo);