get Temp File for Image - Android Graphics

Android examples for Graphics:Image File

Description

get Temp File for Image

Demo Code


//package com.java2s;

import java.io.File;

import android.os.Environment;

public class Main {
    public static File getTempFile(String packageName) {
        final File path = new File(
                Environment.getExternalStorageDirectory(), packageName);
        if (!path.exists()) {
            path.mkdir();/*from ww w  .j a va  2 s.c  o m*/
        }
        return new File(path, "image.tmp");
    }
}

Related Tutorials