是否有可能得到一个Android设备(不是SD卡),通过Android SDK上的可用内存量?
Is it possible to get the amount of free memory on an Android device (not on the SD CARD) via the Android SDK?
如果是这样,如何?
If so, how?
this后可能会合身你的问题。
this post might fit well to your question.
同时检查this螺纹。有这么多的信息在这里的SO。
also check this thread. there is so much info here on SO.
用Google搜索了一下,这里是解决方案(在android混帐)
googled a bit and here is the solution (found at android git)
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long availableBlocks = stat.getAvailableBlocks();
return Formatter.formatFileSize(this, availableBlocks * blockSize);