Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.Environment;

import java.io.File;

import java.io.IOException;

public class Main {
    public static File setOutPutImage(String name) {
        File outputimage = new File(Environment.getExternalStorageDirectory(), name + ".jpg");
        if (outputimage.exists()) {
            outputimage.delete();
        }
        try {
            outputimage.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return outputimage;
    }
}