Showing posts with label Calculate Available External Storage memory. Show all posts
Showing posts with label Calculate Available External Storage memory. Show all posts

Friday, September 16, 2011

Calculate Available External Storage memory

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

Here megAvailable display available External Storage Meomry