How to check Android system information programmatically?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By raccoon
:warning: Old Version Published before Godot 3 was released.

Hey guys, I want to check the manufacturer of the device (For example: Samsung, Sony, etc.) and the version of the operating system of the device (For example: 4.0.4). I also need to check when the game is sent to the background (For example: When someone opens the browser without first closing the game). Does anyone know of an easy way to do these things in Godot?

hello there, i believe you should write a module for it. Write the android java code then compile godot with your module.

mokalux | 2017-03-28 21:50

Hey =D
I’ll probably have to do this. But as there are some similar functions already implemented such as, for example, OS.get_unique_ID() and as the documentation is a bit outdated maybe there was something, not yet documented, to know the android version without needing a whole new module just for this, since it is a very simple thing…

raccoon | 2017-03-29 02:56

for only android, yes, it’s very simple thing.
but Godot engine supports many platforms.
if engine supports these function, it should be functional for as many platforms as possible.
that’s not simple thing…

volzhs | 2017-03-29 17:24

:bust_in_silhouette: Reply From: lukas

Information about manufacturer can be extracted from OS.get_model_name().

Information about sending to background is supposed to be handled by:

func _notification(what):
    if (what == MainLoop.NOTIFICATION_WM_FOCUS_OUT):
        .....