is External Storage Mounted - Android android.os

Android examples for android.os:External Storage

Description

is External Storage Mounted

Demo Code

import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main{


    public static boolean isExternalStorageWritable() {
        String state = Environment.getExternalStorageState();
        if (Environment.MEDIA_MOUNTED.equals(state)) {
            return true;
        }//  w ww  .  ja va  2 s  .co m
        return false;
    }

}

Related Tutorials