How to get program variable of PATH variable in Android?

I wanted to implement the file search function in my Android application, and I wonder how can I get the value of the PATH environment variable from my program?

+5
source share
2 answers
Map<String, String> variables = System.getenv(); 

Iterate through the key list, if PATH exists, find the corresponding value from the map. see link if this helps.

+7
source

.. or you can run adb

adb shell echo \$PATH
+1
source

All Articles