Java tutorial
//package com.java2s; import android.net.Uri; import android.os.Environment; import android.provider.MediaStore; public class Main { private static Uri getUri() { String state = Environment.getExternalStorageState(); if (!state.equalsIgnoreCase(Environment.MEDIA_MOUNTED)) return MediaStore.Images.Media.INTERNAL_CONTENT_URI; return MediaStore.Images.Media.EXTERNAL_CONTENT_URI; } }