Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.Bitmap;

import android.graphics.BitmapFactory;

import android.util.Base64;

public class Main {
    public static Bitmap getBitmapFromBase64encodedImage(String base64EncodedImage) {
        byte[] byteArray = Base64.decode(base64EncodedImage, Base64.DEFAULT);
        Bitmap image = null;
        try {
            image = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return image;
    }
}