apk - How to Access sysfs entry from android application -


can please explain me on how access value exposed sysfs android application.

a reference suggests can not access here

but there 1 android application same.

please explain.

i found answer after research

this how works.

//cmd path of script executed string cmd = "/home_dir/./my_shell_script.sh" ;  runtime run = runtime.getruntime() ;  //this run script java process pr = run.exec(cmd) ;  

the values returned can read this

bufferedreader buf = new bufferedreader(new inputstreamreader(pr.getinputstream())); try {         string string = buf.readline();         char[] text = string.tochararray();         int start = 0;         int len = string.length();         textview.settext(text, start, len);         toast.maketext(this, string, toast.length_short).show();     }      catch (ioexception e)      {         toast.maketext(this, e.getmessage(), toast.length_short).show();     } 

it show variable/output in toast message.

references:

1 executing shell command java

2 /sys/devices/virtual/gpio access java?

please let me know if there other methods this.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -