get SD Card Dir - Android Hardware

Android examples for Hardware:SD Card

Description

get SD Card Dir

Demo Code


//package com.java2s;

import android.os.Environment;

public class Main {
    public static String getSDCardDir() {
        String sdcardPath = Environment.getExternalStorageDirectory()
                .getPath();//  www  .j  av a 2 s  . c  o m
        if (null != sdcardPath && !sdcardPath.endsWith("/")) {
            sdcardPath = sdcardPath + "/";
        }
        return sdcardPath;
    }
}

Related Tutorials