Add this permission below to access resource endpoint/url
<uses-permission android:name="android.permission.INTERNET"/>
If your target endpoint/url only has http add this code below in your manifest.xml. Starting with Android 9 (API level 28), cleartext support is disabled by default.
android:usesCleartextTraffic="true"
Because of that, if you get resource from your unencrypted HTTP API don't forget to add
res/xml/network_security_config.xml
So the code will be like these
network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">urweb.id</domain>
<domain includeSubdomains="true">localhost</domain>
...
<domain includeSubdomains="true">111.222.333.444</domain>
</domain-config>
</network-security-config>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET"/>
<application
...
android:usesCleartextTraffic="true"
...>
<activity>
...
</activity>
</application>
</manifest>