How to consume a TMSXData service from an Android application

How to consume a TMSXData service from an Android application (version 8, 9, 10), created with Embarcadero Delphi 10.3. or 10.4.

The API uses the HTTP protocol (Ex. http://192.168.0.100:2001/tms/xdata, the Android device accesses this link from the LAN).
The problem is that: I get the message "java.io.IOException: Cleartext HTTP traffic to 192.168.0.100 not permitted"

Tools used: Rad Studio 10.3 / 10.4 Ent, TMS ALL-ACCESS latest versions. I tried to modify Androidmanifest.xml, but either, it doesn't work or I can't compile , tried variants:
Option 1.

...
Android targetSandboxVersion = "1"

Variant 2.
android: usesCleartextTraffic = "true"

To allow HTTP you need to change the manifest:

in summary, add

android:usesCleartextTraffic=“true"

attribute to the <application> tag in manifest.

http://docwiki.embarcadero.com/RADStudio/Rio/en/Preparing_an_Android_Application_for_Deployment#Customizing_Your_AndroidManifest.xml_File

Thanks Wagner,

It worked like this:
I added in the project-> Development xml file network_security_config.xml to remote path "res \ xml " with the content:

<?xml version="1.0" encoding="utf-8"?> 192.168.0.100

and I added the following line in the AndroidManifest.template.xml:

<application
...
android:networkSecurityConfig="@xml/network_security_config">

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.