how to convert an image into base64 string

lloyd1981

New Member
I want to convert image to base 64 encode to string. from that to send to server with \[code\]oma_status-icon\[/code\] xml format.but I am getting unsupported encoding from the server response....is there any other way to convert image to base64 string??plz..help...my code is: \[code\] Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(), R.drawable.image); ByteArrayOutputStream bao = new ByteArrayOutputStream(); bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 100, bao); byte [] ba = bao.toByteArray(); String ba1=Base64.encodeBytes(ba);\[/code\]
 
Back
Top