Via Lattanzio,23 Milano
+39 02 36592025
info@synaptica.info

Delphi HTTP Clear Text Traffic on FMX Android

Digital solution partner

Delphi HTTP Clear Text Traffic on FMX Android

Environment:

  • Delphi 11.1 ( used from Delphi XE 10)
  • Android 12 32bit/64bit supported from Android 9 but work with Android 6.0 too

In many cases it may be necessary to access HTTP content on the network where SSL is not available for example:

  • A server within your local network, on a VPN
  • You have an httpServer directly in your application or on your device
  • You need to access particular content on the internet that does not have a certificate available
  • You need to access an IP address directly

To allow your Delphi app to call an HTTP service you need to create a standard android file called “network_security_config.xml” and add it to the list of files to distribute.

In the domain-config section you can list all domains or IPs for which unencrypted traffic is allowed.

At this point it must be added to the project deployment:

It is also necessary to modify the “AndroidManifest.template.xml” file of your project by adding the line:

“android: networkSecurityConfig =” @ xml / network_security_config ”

in the “<application” section.

Compile and test the project 🙂