开发者

How to Calculate Available Internal Storage Memory In MB?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜