An Android P device will block cleartext "http" requests by default for apps that target Android P.
The Java HttpUrlConnection on Android P will throw the following exception when attempt to do a non-https request...
Steps to reproduce:
- Set up "tiapp.xml" to target API Level 28.
- Acquire an Android P device that has Internet access.
- Build and run HttpGetTest.js on the Android P device.
- Tap on the "HTTP Get" button.
- Notice that you get a "Cleartext HTTP traffic to <URL> not permitted" error.
This is also an issue with a WebView loading "http:" pages too.
Can be reproduced with the following...
Simplest solution may be to set the following "AndroidManifest.xml" <application> attribute "android:usesCleartextTraffic" to true for all Titanium built apps by default. This way apps are backward compatible. But allow the Titanium developer to set this to false in the "tiapp.xml".