Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get value of PATH environment variable programatically in Android?

Tags:

android

I wanted to implement a file search function in my Android application and I am wondering how can i get value of "PATH" environment variable from within my program?

like image 853
user1203329 Avatar asked Feb 29 '12 20:02

user1203329


2 Answers

Map<String, String> variables = System.getenv(); 

Iterate through keylist, if PATH exists, findout corresponding value from the map. see this link if it helps.

like image 91
kosa Avatar answered Oct 10 '22 12:10

kosa


.. or you can run adb

adb shell echo \$PATH
like image 42
Blackbelt Avatar answered Oct 10 '22 13:10

Blackbelt