Created
April 24, 2020 22:37
-
-
Save DelphiWorlds/15f6bd1404fcc67ba72edc691ca34912 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
Androidapi.JNI.App, Androidapi.Helpers, Androidapi.JNI.GraphicsContentViewText; | |
// Available memory in MB | |
function GetMemory: Int64; | |
var | |
LMemoryInfo: JActivityManager_MemoryInfo; | |
LActivityManager: JActivityManager; | |
begin | |
LActivityManager := TJActivityManager.Wrap(JObjectToID(TAndroidHelper.Context.getSystemService(TJActivity.JavaClass.ACTIVITY_SERVICE))); | |
LMemoryInfo := TJActivityManager_MemoryInfo.Create; | |
LActivityManager.getMemoryInfo(LMemoryInfo); | |
Result := Round(LMemoryInfo.availMem / $100000); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment