Android Question [Solved] Android 28 and non-ssl (non-https) communication

asales

Expert
Licensed User
Longtime User
I use B4A 9.30 and OkHttpUtils2 in most of my apps to download images and post/get to a PHP server hosted in a non-https site.

I just change the target SDK to 28 in manifest and compile the app.
Until now all the functions thats uses internet still working.

When I need to use this lines in my apps?:
B4X:
CreateResourceFromFile(Macro, Core.NetworkClearText)
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
whats is a "non-ssl (non-https) communication" in B4A?
communication with a webservice over http. Not https
I need to use this lines in the manifest?
with targetsdk 28 yes if you do use http instead of https.

Scure your webservice and add a SSL Certificate. Use HTTPS and you dont need this in manifest.
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Thanks.
I tested the app in a device with Android 9 and if I don't put the line, I get this error:
B4X:
ResponseError. Reason: java.net.UnknownServiceException: CLEARTEXT communication to www.myserverphp.com not permitted by network security policy, Response:

So, problem solved. I need this line.
 
Upvote 0
Top