If you use environment variables for testing purposes and do not have the functionality that will depend on them during production, this answer may be useful. However, if you interact and use JNI libraries and want to use environment variables as a directive for these libraries, then I'm not sure if they are usable.
In API 21, Google introduced the Os class to provide system-level access to developers. I have not tried it yet, but it should be the interface between the Android application and the underlying Linux kernel. Which, I hope, is what you need. There is, of course, the setenv method , which delegates the options you set on Linux setenv .
, , , API 21, , Android .