Your program doesn't work, but it doesnt matter., I guess this DTR solves everything.
I installed the SerialOTG application and tried connections with and without DTR. So the DTR resets the board and when it connects, it normally asks for the nickname, but I need to find out if the DTR affects the operation yet, or should it be turned off while downloading and uploading data from and to the arduino. I do not know what the DTR really is, but I will read it in a moment. Sorry for english.
I do not understand what you mean. I look at the arduino and with the option enabled, the led "power" icon on the arduino goes off (that is, it resets during serial connection) when the DTR option is off the led does not go out. which sketch do you need?
Ah - lost in language translation. I want to see where the Sketch originally came from (didn't you mention the Arduino forum?) as there could be key information about it.
Just read the above again. The App should never be running when the cable is plugged in or removed.
Also, because of Google Security Measures, we probably need to have Google Locate switched on (we have found this to be necessary for Apps that use Bluetooth for example).
You mean "permission" to use the device, I read somewhere that it can be set, but it's too much for me at once.
And in the application from the "Serial USB Monitor" play store, the permission itself is set once. But to connect, after pressing "connect" resets arduino.
We have to ask for that permission in the App code, then we can store the granting of permission so that it does not get asked again. However, the SerialOTG extension does not ask and App Inventor does not either - hence the complex solution of editing the APK Manifest.