Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting base64 String to image in Android

Is there any way that I can convert a base64 String to image in Android? I am receiving this base64 String in a xml from the server connected through socket.

like image 275
user291977 Avatar asked May 25 '10 06:05

user291977


2 Answers

Have a look at http://www.source-code.biz/base64coder/java/ or any other example that converts base64 strings to byte-arrays, and then use the ImageIcon(byte[] imageData) constructor.

like image 97
aioobe Avatar answered Nov 15 '22 00:11

aioobe


There are now Base64 utilities in Android, but they only became available with Android OS 2.2.

like image 32
ThomasW Avatar answered Nov 14 '22 23:11

ThomasW