The reason for this is that most of the time when the server is set up it is not specifically set to HTTPS mode and newer Versions of Android (Q and above) will not allow HTTP access by default, so we need to change 1 by adding configuration. Start by creating a configuration XML file


      
<network-security-config>
    <base-config cleartextTrafficPermitted="true" />
</network-security-config>
Copy the code

This file is then configured in the Application tag in androidmanifest.xml

 android:networkSecurityConfig="@xml/network_security_config"
Copy the code

As is shown in



Then recompile and run it