Thank you so much @Hossein, this extension contains exactly what I was looking for, and will let me build the app I want to.
Just a few small bits of feedback:
My device has 64GB internal storage, no external storage and 6GB of RAM. From the screenshot I can see that the external storage is emulated by my device (good to know!). The internal and external storage methods return the size in bits, while the RAM method converts to bytes and returns this value. Thanks to the link you shared I was able to find this in
long availableMegs = mi.availMem / 1048576L;
As a side point, saying “RamMemory” sounds silly to me. I know you didn’t create this method, but “random access memory memory” is tautological.
Secondly, can I respectfully suggest the all the
InternalMemory methods be renamed to
InternalStorage? This is what they are referred to in the Android documentation that @Andres_Cotes has linked to, for example:
Finally, the developer on inducesmile.com has used deprecated methods for calculating the total internal and external storage size. (Possibly they weren’t deprecated when that article was written?). The latest methods are available in the StatFs documentation:
I would guess that the current code will work for the vast majority of Android devices currently available, but switching from ints to longs will future-proof this (very helpful!) extension.
Thanks again for all your hard work, I’m quite impressed by how quickly your team was able to get this extensions shipped!