Here you can find the source of decoderBase64File(String base64Code, String type)
public static String decoderBase64File(String base64Code, String type)
//package com.java2s; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import android.os.Environment; import android.util.Base64; import android.util.Log; public class Main { public static String decoderBase64File(String base64Code, String type) { String sdStatus = Environment.getExternalStorageState(); if (!sdStatus.equals(Environment.MEDIA_MOUNTED)) { Log.i("TestFile", "SD card is not avaiable/writeable right now."); return "unavailable"; }/*from w w w .j a va 2s . com*/ File file = new File("/sdcard/myDoc/"); if (!file.exists()) { file.mkdirs(); } String name = "tempfile." + type; String filePath = "/sdcard/myDoc/" + name; byte[] buffer = Base64.decode(base64Code, Base64.DEFAULT); try { FileOutputStream out = new FileOutputStream(filePath); out.write(buffer); out.close(); } catch (IOException e) { e.printStackTrace(); } return filePath; } }