Base64 decode to a Bitmap - Android android.graphics

Android examples for android.graphics:Bitmap Load Save

Description

Base64 decode to a Bitmap

Demo Code

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Base64;
import android.util.Log;
import java.io.ByteArrayOutputStream;

public class Main{


    public static Bitmap decodeBase64(String input) {
        byte[] decodedByte = Base64.decode(input, 0);
        return BitmapFactory.decodeByteArray(decodedByte, 0,
                decodedByte.length);//from   www .  j a v a  2 s  .com
    }

}

Related Tutorials