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 {
    public static final String TAG_IMAGE = "<image>";

    public static Bitmap getImage(String body) {
        int index = TAG_IMAGE.length();
        body = body.substring(index);
        byte[] imageData = Base64.decode(body, Base64.DEFAULT);
        return BitmapFactory.decodeByteArray(imageData, 0, imageData.length);

    }
}