title: android : how to run a shell command from within code
body: <p>I am trying to execute a command from within my code,
   the command is "echo 125 > /sys/devices/platform/flashlight.0/leds/flashlight/brightness"
   and I can run it without problems from adb shell</p>
  
  <p>I am using Runtime class to execute it :</p>
  
  <pre><code>Runtime.getRuntime().exec("echo 125 &gt; /sys/devices/platform/flashlight.0/leds/flashlight/brightness");
  </code></pre>
  
  <p>However I get a permissions error since I am not supposed to access the sys directory.
   I have also tried to place the command in a String[] just in case spaces caused a problem but it didn't make much differense.</p>
  
  <p>Does anyone know any workaround for this ?</p>