Your Android app works over Wi-Fi. You connect a VPN, reopen the app and immediately see “No internet connection.”
Meanwhile, another app loads new content without a problem.
Before changing DNS settings or blaming the VPN server, check whether your app actually attempted a request.
An offline message can come from a faulty connectivity check before any network operation starts. If the app rejects a connection based on its transport type, the error may describe your code’s assumptions rather than the phone’s connectivity.
Here is how to investigate.
1. Find the code that decides the app is offline
Search for the condition that displays the message or prevents the request.
A transport-based check might look like this:
val acceptedTransport = capabilities . hasTransport ( NetworkCapabilities . TRANSPORT_WIFI ) || capabilities . hasTransport ( NetworkCapabilities . TRANSPORT_CELLULAR )
Enter fullscreen mode
Exit fullscreen mode
That tells you whether those transports are reported.…