I forsee that my application will require the existence of a sdcard storage device. How do I query the device for a manifest of storage options ?
Click "Start" and then "Computer" on your computer or laptop. Your Android SD card will be listed as a "Removable Disk" below the "Devices with Removable Storage" section.
As a rule, most Android and Windows Phone devices include a micro SD slot, usually located beside the SIM card slot on the back or side. Some phones don't have it, but it's pretty easy to check whether there is one or not (Remember it's a micro SD card you're looking for as a regular SD card won't fit).
Android, simply check Settings > Storage (depending on the device) and it should have headings for internal and external storage. If there is an external storage header, that means that there is an SD card installed.
You can use getExternalStorageState()
. The developer site (linked here) has a short snippet of the recommended way to check for the presence of the external SD card, and whether or not you can write to it.
This is working and very easy to understand
TextView state = (TextView) findViewById(R.id.sdcardstatus);
if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
state.setText("SD card is present");
} else {
state.setText("SD card is not present");
}
Or refer on this tutorial
HAPPY CODING!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With