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.os.Environment;

public class Main {
    private static String sdState = Environment.getExternalStorageState();

    public static void creatFile(String fileName) {
        if (sdState.equals(Environment.MEDIA_MOUNTED)) {
            File file = new File(
                    Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + fileName);
            if (!file.exists()) {
                file.mkdir();
            }
        }
    }
}