IOException: Cleartext HTTP traffic to 159.8.29.23 not permitted code example

Example 1: android manifest cleartext traffic permitted

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>
</manifest>

Example 2: android:usesCleartextTraffic="true"

<?xml version="1.0" encoding="utf-8"?><manifest ...>    <uses-permission android:name="android.permission.INTERNET" />    <application        ...        android:usesCleartextTraffic="true"        ...>        ...    </application></manifest>

Tags:

Java Example