Monday 15 July 2013

android - available space in sd card and internal memory -



android - available space in sd card and internal memory -

i want available space in sd card , internal memory

i used next code available space in internal memory

statfs stat = new statfs(environment.getexternalstoragedirectory().getpath()); double sdavailsize = (double) stat.getavailableblocks() * (double) stat.getblocksize(); // 1 binary gigabyte equals 1,073,741,824 bytes. double gigaavailable = sdavailsize / 1073741824;

but thr anyway can available space in sd card , know sure cannot utilize sd card on kit-kat , if using jelly beans , thr anyway can access sd card available space

device 4.1.2

there no way know path external sd card on pre-kitkat devices, api getexternalfilesdirs() available in kitkat. can utilize various hacks guess sd card path, illustration reading /proc/mounts, described in answer

android sd-card

No comments:

Post a Comment