开发者

How to Calculate Available Internal Storage Memory In MB?

开发者 https://www.devze.com 2023-02-22 06:18 出处:网络
I want to calculate available Internal Stora开发者_运维技巧ge Memory in MB ? How can i get the value of that ?

I want to calculate available Internal Stora开发者_运维技巧ge Memory in MB ?

How can i get the value of that ?

Please Help me........


hi chirag using the following function you can calculate available Internal Storage Memory in MB.

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

enjoy...........

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号