This Function check SD Card is mounted to Android Device (return true/false). - Android Hardware

Android examples for Hardware:Device Feature

Description

This Function check SD Card is mounted to Android Device (return true/false).

Demo Code


//package com.java2s;

public class Main {
    /**//  w w  w.  j a  v  a  2  s.  c  o m
     * This Function check SD Card is mounted to Android Device (return
     * true/false).
     */

    public static boolean isSdPresent() {
        return android.os.Environment.getExternalStorageState().equals(
                android.os.Environment.MEDIA_MOUNTED);
    }
}

Related Tutorials