Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import android.os.Environment;

public class Main {
    public static final String JPEG_EXTENSION = ".jpg";

    /**
     * Construct a File for an xxxx.jpg image in the external storage directory
     * 
     * @param name
     *            the 'xxxx'
     * @return File
     */
    public static File constructExternalImageFile(String name) {
        File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
        File imageFile = new File(storageDir, name + JPEG_EXTENSION);
        imageFile = imageFile.getAbsoluteFile();
        return imageFile;
    }
}