Check if Sd Card can be used - Android Hardware

Android examples for Hardware:SD Card

Description

Check if Sd Card can be used

Demo Code


//package com.java2s;

import android.os.Environment;

public class Main {
    public static boolean IsCanUseSdCard() {
        try {/*w ww  .  j a  v  a 2  s  . co m*/
            return Environment.getExternalStorageState().equals(
                    Environment.MEDIA_MOUNTED);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}

Related Tutorials