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 android.content.Context;
import android.os.Environment;

public class Main {
    private static String mStorePath = null;
    private static Context mContext = null;

    public static String getStorePath() {
        if (mStorePath == null) {
            String path = Environment.getExternalStorageDirectory().getPath();
            if (path == null || !Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
                path = mContext.getFilesDir().getPath();
            }
            if (!path.endsWith("/")) {
                path = path + "/";
            }
            mStorePath = path;
        }
        return mStorePath;
    }
}