Network behavior (internal vs. external) not precise

I have several issues with the Android app:
The app is not very good in detecting if I am in the internal network. It happens regularly that the app tries to connect to the external URL while being in the internal network.
Is there any reason that might influence this behavior?

AFAIK the app starts a tcp connection to the internal host, when on wifi or ethernet. If the host is reachable the local connection is established.
Can you capture a debug log from the app?