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 getSDCardPath() {
        if (isSDCardExist()) {
            File file = Environment.getExternalStorageDirectory();
            return file.getPath();
        } else {
            return null;
        }
    }

    public static boolean isSDCardExist() {
        if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
            return true;
        } else
            return false;
    }
}