I want to get the size of free memory on internal/external storage of my device programmatically. I\'m using this piece of code :
StatFs stat = new StatFs(En
Since API 9 you can do:
long freeBytesInternal = new File(ctx.getFilesDir().getAbsoluteFile().toString()).getFreeSpace(); long freeBytesExternal = new File(getExternalFilesDir(null).toString()).getFreeSpace();