Question

I was wondering how I can get the information about any memory card, internal storage that an android device have! what I want is the free, used memory amount and if possible the extra details about memory card! ( not the internal Storage )

Was it helpful?

Solution

This will help you to get free memory of external storage:

StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getPath());
long bytesAvailable = (long)stat.getBlockSize() * (long)stat.getAvailableBlocks();
long megAvailable = bytesAvailable / (1024 * 1024);
Log.d("","Available MB : "+megAvailable);

Hope this will help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top