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 {
    public static String makeDir(String dirName) {
        String mRootPath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + dirName;

        try {
            File fRoot = new File(mRootPath);
            if (fRoot.exists() == false) {
                if (fRoot.mkdirs() == false) {
                    throw new Exception("");
                }
            }
        } catch (Exception e) {
            mRootPath = "-1";
        }

        return mRootPath + "/";
    }
}