I have a public API that I have to use in the app. The API doesn't provide a https
, so I would like to allow Cleartext access.
However I'm still supporting KitKat (API 19).
Therefore this solution <application android:networkSecurityConfig="@xml/network_security_config">
leads to the error:
Attribute networkSecurityConfig is only used in API level 24 and higher (current min is 19)
So what do I do in this case?
network_security_config
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">http://....com/json/</domain>
</domain-config>
</network-security-config>