Hi,
see
http://derekmolloy.ie/beaglebone/beaglebone-gpio-programming-on-arm-embedded-linux/ for more information.
There are also 2 pdfs with p9, p8 header tables for the pin muxing.
If you whant persistent pin muxing changes on the BBB you must change the device tree overlay!!!.
To check if its work in general us the adb shell.
An example for the p8.09:
./adb shell
cd /sys/class/gpio
echo 69 > export //creates gpio69 directory for the gpio access
chmode 777 gpio // to get access for the apk. the apk is never running as root.
cd gpio69
chmod 777 value
chmode 777 direction
you can change the direction and value by
echo 1 > value // set gpio high
echo out > direction // set gpio as output
have fun,