You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to read and write to GPO pins of Qualcome MSM8909 running Simple android OS not Android things. I am able to do the same with adb but when i am trying to do same with android App its giving me permission denied error. So I can only able to read these pins but cant able to write anything to it.
Please Help.
This is what I have tried
var outp = exe?.Executer("echo 0 > /sys/class/gpio/gpio942/value")
Log.d("Output", "My INPUT $outp")
outp = exe?.Executer("cat /sys/class/gpio/gpio942/value")
Log.d("Output", "My OUTPUT $outp")
//
public class ShellExecuter {
public ShellExecuter() {
}
public String Executer(String command) {
StringBuffer output = new StringBuffer();
Process p;
try {
p = Runtime.getRuntime().exec(command);
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = reader.readLine())!= null) {
output.append(line + "\n");
}
} catch (Exception e) {
e.printStackTrace();
}
String response = output.toString();
return response;
}
}
The text was updated successfully, but these errors were encountered:
I am trying to read and write to GPO pins of Qualcome MSM8909 running Simple android OS not Android things. I am able to do the same with adb but when i am trying to do same with android App its giving me permission denied error. So I can only able to read these pins but cant able to write anything to it.
Please Help.
This is what I have tried
var outp = exe?.Executer("echo 0 > /sys/class/gpio/gpio942/value")
Log.d("Output", "My INPUT $outp")
//
public class ShellExecuter {
}
The text was updated successfully, but these errors were encountered: