I am working on how to connect my app to a server which is running on NodeJS and MongoDB, I am relatively a beginner so I wondered how do i connect them, I am currently using Retrofit for making a connection as many suggested I have created a network security config xml file I have tried it then i have seen this article in android website suggesting it is discontinued after android 8.1 text
I am getting an error of CLEARTEXT communication to localhost (I also tried with 10.0.2.2) is not permitted by network security policy. I have also checked the YouTube for any recommends but nobody has worked on it yet... Can anybody suggest/write the answer
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">10.0.2.2</domain> <!-- If using emulator -->
<!-- Add other domains as needed -->
</domain-config>
</network-security-config>
as well as in AndroidManifest.xml
android:usesCleartextTraffic="true"
I have added it too