unknown os platform
how to convert a base64 string to bitmap in android example | Whats-online.info
whats-online-info

how to convert a base64 string to bitmap in android example


how
2017/01/20 / Science and Tutorials

Android code: how to convert a base64 string to a bitmap image. See an example





android code: how to convert a base64 string to bitmap image




On our earlier tutorial, we learned how to convert bitmap image to base64 string in android programmatically. For this post, i will show how to decode the base64 string back to bitmap image as shown in the example below.

public static Bitmap decodeBase64(String input)     {         byte[] decodedBytes = Base64.decode(input, 0);         return BitmapFactory.decodeByteArray(decodedBytes, 0, decodedBytes.length);     }

The function above decodes the base64 string to bitmap image and returns a bitmap image


Decode Bitmap image

Bitmap decodeTxt=decodeBase64(encodedString);

Thanks for your time. Like us on facebook, twitter, and Google plus to get the latest tuts updates close to your social network profile











You may also like:


Leave a comment












Subscribe to get replies direct to your mailbox

Submit comment