Pregunta

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 )

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top