Android : available space in sd card and internal memory

on Tuesday, October 28, 2014


i want to get available space in SD card and the internal memory


i used following code to get available space in internal memory



StatFs stat = new StatFs(Environment.getDataDirectory().getPath());
double sdAvailSize = (double) stat.getAvailableBlocks()
* (double) stat.getBlockSize();
// One binary gigabyte equals 1,073,741,824 bytes.
double gigaAvailable = sdAvailSize / 1073741824;


But is thr anyway that i can get available space in SD card , i know for sure that i cannot use SD card on Kit-kat , but if i am using jelly beans , is thr anyway that i can access to SD card available space


0 comments:

Post a Comment