It works now, but not with the code of the online course. I just used
chmod 222 /sys/class/gpio/export
chmod 222 /sys/class/gpio/unexport
echo 915 > /sys/class/gpio/export
chmod 777 /sys/class/gpio/gpio915
chmod 777 /sys/class/gpio/gpio915/value
chmod 777 /sys/class/gpio/gpio915/direction
My idea was to be able to export the pins I needed in java if I set the permissions of export, but that doesn't work.
With this code I can only control pin 915.
The problem seems to be the loop. I tried to enter it in the console directly (in android studio) but it wouldn't accept the curly brackets. It isn't a problem of the keyboard, because it also rejected them when pasting the code into the console.
Anyway, I will just set the permissions of every pin I need manually for now.
Thank you for your help!