getting storage information in android -


I was wondering how can I get information about any memory card, internal storage in an Android device is! What do I need for free, used memory amount and additional details about memory cards if possible! (Internal Storage)

This will help you to get free memory of external storage:

  statfs stat = new statfs (environment .getExternalStorage directory (.) GetPath ()); Long bytes available = (long) stat.getBlockSize () * (long) stat.getAvailableBlocks (); Long Mega Available = bytes Available / (1024 * 1024); Log D. ("", "Available MB:" + Mega available);   

Hope this will help you.

Comments