Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.BitmapFactory;

import android.util.Base64;

public class Main {
    /**
     * decode from a base64 to a bitmap
     * 
     * @param base64
     * @return
     */
    public static Bitmap decodeFromBase64(String base64) {
        byte[] bitmapArray = Base64.decode(base64, Base64.NO_WRAP | Base64.URL_SAFE);
        return BitmapFactory.decodeByteArray(bitmapArray, 0, bitmapArray.length);
    }
}