How to get memory usage ( total, free, used )
I have found this java code since I didnt find anything similar here in forum, but I dont
know how to add this code in timer...
I have found this java code since I didnt find anything similar here in forum, but I dont
know how to add this code in timer...
B4X:
public static long getUsedMemorySize() {
long freeSize = 0L;
long totalSize = 0L;
long usedSize = -1L;
try {
Runtime info = Runtime.getRuntime();
freeSize = info.freeMemory();
totalSize = info.totalMemory();
usedSize = totalSize - freeSize;
} catch (Exception e) {
e.printStackTrace();
}
return usedSize;
}