This is for WiFi. When we're not connected to WiFi, I send a request to a stable link (up, most of the time at least) for e.g. google.com. If I get a success, I assume we are connected using our 4G.
Sorry, Makis.
I haven't use B4A for a few years (doing everything in B4J and ABMaterial these days).
The code above is from one of my last projects in B4A, where I checked that a connection was present. I have no clue about how you could check specifically for 4G data connection.