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 {
    static String mPrivatePath = "/cartman_mm/";

    public static String createNewPrivateFolder(String folderName) {
        String folderPathString = getSDPath() + mPrivatePath + folderName;
        if (folderPathString.charAt(folderPathString.length() - 1) != '/') {
            folderPathString += '/';
        }
        File path = new File(folderPathString);
        if (!path.exists()) {
            path.mkdir();
        }
        return folderPathString;
    }

    private static String getSDPath() {
        return Environment.getExternalStorageDirectory().getPath();
    }
}