On second thought there is a difference,

The problem isn't just a sequence of instructions but having
sufficient permission to execute. The Java JVM does not run as root.
So,you need something that runs as root to change permissions to
enable Java access.

IMO a script maybe the best solution since it is easily integrated
into initrc. In fact, that is a large part of what that script does.

On Jan 1, 7:13 pm, Chris Stratton <cs07...@gmail.com> wrote:
> On Dec 30 2010, 12:19 pm, A Curtis <ajcurti...@gmail.com> wrote:
>
> > This is basically what I did to access a GPIO from Java land.
>
> > echo "128" >/sys/class/gpio/export
> > echo "out" > /sys/devices/virtual/gpio/gpio128/direction
> > chmod 0666 /sys/devices/virtual/gpio/gpio128/value
>
> Just FYI, that's not accessing sysfs directly from java, but
> apparently issuing shell commands to do so.  I can't think of any good
> reason you shouldn't be able to accomplish this task using java file i/
> o functions directly.

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to