I like to show internal/external memory left on android. I use this code, i am not actually getting real size left or total storage capacity. Instead of showing 1GB left out of 16GB with 15.07GB used on phone it was tested as indicated below:
Marked with red is what i got when code below was used:
Please , i want someone to please help me with correct code to show internal/external memory left on android.
Marked with red is what i got when code below was used:
To determine memory left:
''to determine memory left
Dim r As Reflector
''manifest: SetApplicationAttribute(android:largeHeap,"true")
r.Target = r.RunStaticMethod("java.lang.Runtime", "getRuntime", Null, Null)
FreeMemorypublic1 = (r.RunMethod("freeMemory")/(1024*1024)) '& " MB"
MaxMemorypublic = (r.RunMethod("maxMemory")/(1024*1024)) '& " MB"
availableMemorypublic = ((r.RunMethod("maxMemory") - r.RunMethod("totalMemory"))/(1024*1024)) '& "MB"
Please , i want someone to please help me with correct code to show internal/external memory left on android.
Last edited: