Closed Farbfinsternis closed 8 months ago
No matter which environment variable I want to query on Android, the result is empty.
Which environment variables have you tried? ANDROID_HOME
isn't defined by default on Android to my knowledge.
Note that Android has a lot of security measures in place, so I wouldn't be surprised if this was blocked on non-rooted devices.
try "DIRECTORY_DCIM", should be the directory for the captured images. An empty string is returned.
CC @m4gr3d
Works as expected, just doesn't support a lot of env variables.
For example it works with the PATH
env variable: print("FHK - Testing env variable: " + OS.get_environment("PATH"))
returns:
FHK - Testing env variable: /product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
From a quick test on a Pixel 5 device, here are the supported env variables (retrieved using [System.getenv()
](https://developer.android.com/reference/java/lang/System#getenv())):
13:22:40.018 MainActivity D FHK - Printing Env variables:
13:22:40.018 MainActivity D FHK - SYSTEMSERVERCLASSPATH
13:22:40.019 MainActivity D FHK - PATH
13:22:40.019 MainActivity D FHK - ANDROID_SOCKET_zygote
13:22:40.019 MainActivity D FHK - ANDROID_I18N_ROOT
13:22:40.019 MainActivity D FHK - FIRST_STAGE_SNAPUSERD_PID
13:22:40.019 MainActivity D FHK - ANDROID_DATA
13:22:40.019 MainActivity D FHK - ASEC_MOUNTPOINT
13:22:40.019 MainActivity D FHK - ANDROID_TZDATA_ROOT
13:22:40.019 MainActivity D FHK - EXTERNAL_STORAGE
13:22:40.019 MainActivity D FHK - ANDROID_BOOTLOGO
13:22:40.019 MainActivity D FHK - ANDROID_ASSETS
13:22:40.019 MainActivity D FHK - FIRST_STAGE_SNAPUSERD_INFO
13:22:40.019 MainActivity D FHK - TMPDIR
13:22:40.019 MainActivity D FHK - ANDROID_STORAGE
13:22:40.019 MainActivity D FHK - STANDALONE_SYSTEMSERVER_JARS
13:22:40.019 MainActivity D FHK - DEX2OATBOOTCLASSPATH
13:22:40.019 MainActivity D FHK - ANDROID_ART_ROOT
13:22:40.019 MainActivity D FHK - ANDROID_ROOT
13:22:40.019 MainActivity D FHK - DOWNLOAD_CACHE
13:22:40.019 MainActivity D FHK - BOOTCLASSPATH
13:22:40.019 MainActivity D FHK - ANDROID_SOCKET_usap_pool_primary
Tested versions
No matter which environment variable I want to query on Android, the result is empty.
System information
Android 14, Godot 4.2
Issue description
No matter which environment variable I want to query on Android, the result is empty.
Steps to reproduce
Versuche einfach eine Environment Variable unter Android auszugeben
Minimal reproduction project (MRP)
func _ready() -> void: label.text = "DCIM: " + OS.get_environment("ANDROID_HOME")