Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;

import android.content.Context;

import android.os.Environment;

public class Main {
    /**
     * Creates a temporary file with the specified prefix and extension.
     * 
     * @param part
     *            the prefix for the file
     * @param ext
     *            the extension for the file
     * @param context
     *            the application's context
     * @return the created File
     * @throws Exception
     */
    private static File createTemporaryFile(String part, String ext, Context context) throws Exception {
        File tempDir = Environment.getExternalStorageDirectory();
        tempDir = new File(tempDir.getAbsolutePath() + "/bv-temp/");
        if (!tempDir.exists()) {
            tempDir.mkdir();
        }
        return File.createTempFile(part, ext, tempDir);
    }
}