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

import java.io.File;

public class Main {
    public static String CACHE_FILE = "";

    public static String GetCacheFilePath() {
        String filePath = "";
        String rootpath = GetSdcardSystemPath();
        filePath = rootpath + CACHE_FILE;
        File file = new File(filePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return filePath;
    }

    public static String GetSdcardSystemPath() {
        String rootpath = "";
        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            rootpath = Environment.getExternalStorageDirectory().toString();
        }
        return rootpath;
    }
}