MemoryInfo extension


#1

Based on request HERE, AppyBuilder developed MemoryInfo extension that can be used to get size of built-in, internal, external memory size.

NOTE: This is version 1 and released for your testing :slight_smile:

Get it from here:


#2

Does it make sense to create existing?

image

image

image


Checking available storage before downloading files?
#3

@Andres_Cotes No it doesn’t :slight_smile:
I didn’t know about your extension until Taifun mentioned about it. However, this was after we had developed it.
Looking at your blocks, I think we are both using the same reference: https://inducesmile.com/android/how-to-get-android-ram-internal-and-external-memory-information/


#4

@Andres_Cotes to reduce confusion, I can remove our extension


#5

yo la cree desde aqui
https://developer.android.com/reference/android/os/Environment.html

pero pero tiene muy buenos metodos

este es el listado de extensiones

puravidaapps.com


#6

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 freeRamMemorySize()

    long availableMegs = mi.availMem / 1048576L;
    return availableMegs; 
Side point:

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 ExternalMemory and InternalMemory methods be renamed to ExternalStorage and 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:
https://developer.android.com/reference/android/os/StatFs.html#getAvailableBlocks()
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!


#7

Hi @Andres_Cotes,

Thanks for your comment, however my original post, and subsequent clarifications, clearly stated that I was looking for a way to check the RAM on a device and not the storage. I originally used your extension but when I found out that it only provided information on storage I put a request out to the community.

First I outlined the question:

Then I was recommended to look at the existing extensions:

Finally your extension was suggested:

You have created a very useful extension but it just didn’t have the feature that I was looking for for my project, so in that regard the AppyBuilder extension is different from your existing extension.

Perhaps in Spanish the words are the same, but even memory manufacturers distinguish between storage and memory:

Thanks again for all you hard work developing extensions, I’ve used them in the past and I’m sure I’ll need to use them again in the future.

Best wishes,

D.


#8
  1. I haven’t really tried @Andres_Cotes extension, but seems like we need to keep this extension (won’t be deleted).
  2. Updated extension (version 2) which now includes @Domhnall suggestions for renaming blocks:

#9

Amazing, thank you @Hossein!


#10

creo que esta es la clase que necesitan

https://developer.android.com/reference/android/app/ActivityManager.MemoryInfo.html


#11

seria bueno un evento cuando la memoria este en lowmemory


#12

@Andres_Cotes we had previously looked into that and have some information about it. We’ll continue to research about this feature