Well, in fact in a previous post I planned to tell you that this option has already been implemented in AI2Offline, several versions ago.
Anyway, thanks, and greetings from Mexico.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Wow, I did not notice that one. It's all good it all gets me more familiar with the code base.
BTW, I just put the cleartextTrafficPermitted toggle in there this evening.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem as I'm seeing it is that cleartext is not a runtime option it can't be toggled at its an AndroidManifest.xml thing. Why its always false for the companion is because companion is just an AI2 app and what it does is actually make the method calls associated with whatever that component is (Form.class aka Screen1). So because the companion does not have the cleartextTrafficPermitted=true in its own properties file so at build time buildserver packages it with false.
A quick fix would be to add the line: cleartextTrafficPermitted=True
to appinventor-sources/appinventor/aiplayapp/youngandroidproject/project.properties run ant again to rebuild the companion app.
However this is an option that will never be toggled with companion it just sets up the network_security_config.xml so I would just make sure companion gets built true and call it a day.
I suppose I could put an isForCompanion check around it in the code. I'll do whichever
Cheers!
Last edit: Andrew Williams 2022-12-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've implemented WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON for keeping the screen turned on and bright.
Works great on my phone (Android 9), requires testing but I don't foresee any problems as its a pretty simple thing.
Looking forward to you feedback.
Github
Well, in fact in a previous post I planned to tell you that this option has already been implemented in AI2Offline, several versions ago.
Anyway, thanks, and greetings from Mexico.
Wow, I did not notice that one. It's all good it all gets me more familiar with the code base.
BTW, I just put the cleartextTrafficPermitted toggle in there this evening.
I have this simple project, and it doesn't matter if the option is checked or not, the result is the same.
Ugh, Fixed and pushed typo. My brain camelCased clearText.
hi andrew, there is an error in cleartext when compiling the companion, it is being set to false instead of true.
The problem as I'm seeing it is that cleartext is not a runtime option it can't be toggled at its an AndroidManifest.xml thing. Why its always false for the companion is because companion is just an AI2 app and what it does is actually make the method calls associated with whatever that component is (Form.class aka Screen1). So because the companion does not have the cleartextTrafficPermitted=true in its own properties file so at build time buildserver packages it with false.
A quick fix would be to add the line: cleartextTrafficPermitted=True
to appinventor-sources/appinventor/aiplayapp/youngandroidproject/project.properties run ant again to rebuild the companion app.
However this is an option that will never be toggled with companion it just sets up the network_security_config.xml so I would just make sure companion gets built true and call it a day.
I suppose I could put an isForCompanion check around it in the code. I'll do whichever
Cheers!
Last edit: Andrew Williams 2022-12-21