Friday, September 16, 2011

Calculate Total External Storage memory

StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getPath());
long bytesAvailable = (long)stat.getBlockSize() *(long)stat.getBlockCount();
long megAvailable = bytesAvailable / 1048576;

Here megAvailable display total External Storage Memory

No comments:

Post a Comment

Post a Comment