We are developing an application which reads data from a serial device. Existing C++ code is reused as a shared library (libProtocol.so is built using NDK) to read and decode the data from the device and pass it to the application. But when the device is connected, the shared library code is not able to access the device because of the permission issues. In adb shell command ls -l/dev/ttyUSB0 shows "crw------- root root". If I mannually use chmod 777 ttyUSB0 from adb and after that run the application, it is able to open the port. (If I create a C++ exe to access USB Serial port and run in android environment, it is able access the port but accessing from shared library fails)

1. Is it possible to change the permissions permanently?
2. Does android run as a root or any other user?
3. Generally ttyUSB0 belongs to dialout group, why it is showing as root and crw------- instead of crw-rw---- ?
4. Why accessing from exe works and accessing from shared library falils?

Hardware platform : Beagle Board - XM
OS: Android Froyo
Can anyone please help?

Thank you.