質問

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 )

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top