Since this application is already on Google Play and people will need to use it more and more (it's for specialized medical staff), it's a must that 3G access should work. So whenever I test it, I do it independently of my computer, meaning I always set the debug mode to Release (obfuscated).
I attached here an archive with a very simplified project that does just that: check the file size, and in different situations outputs the "network on main thread exception" error.
The cases when the error does NOT appear:
* app on mobile phone debugged in Release (obfuscated) mode, mobile phone NOT connected to B4A in any way, WiFi internet access turned ON
* app on mobile phone debugged in Release mode, mobile phone NOT connected to B4A in any way, WiFi internet access turned ON
* app on mobile phone debugged in Debug (legacy), mobile phone connected to B4A by USB, WiFi internet access turned ON
* app on mobile phone debugged in Debug (rapid), mobile phone connected to B4A by USB, WiFi internet access turned ON
* app on mobile phone debugged in Debug (rapid) mode, mobile phone connected to B4A by USB, WiFi internet access turned OFF, so 3G is ON
The cases where the error DOES appear:
* app on mobile phone debugged in Release (obfuscated) mode, mobile phone NOT connected to B4A in any way, WiFi internet access turned OFF, so 3G is ON
* app on mobile phone debugged in Release mode, mobile phone NOT connected to B4A in any way, WiFi internet access turned OFF, so 3G is ON
* app on mobile phone debugged in Debug (legacy) mode, mobile phone connected to B4A by USB, WiFi internet access turned OFF, so 3G is ON
So using the Debug (rapid) helps, since it disables the error, but obviously the app is computer-dependent at that time. The question still remains why does this occur in Release modes only on 3G and never on Wifi.