Android - force network requests go through wifi instead of mobile network <p>I have an app which connects to a hardware device Wi-Fi hotspot. It seems that Android forward requests over other networks (3G/4G for example) instead the hotspot, since my hot spot has no internet connection.</p> <p>Is there any way to force network stream to work on the wifi? I've come across the following function, but it's deprecated: <a href="https://developer.android.com/reference/android/net/ConnectivityManager.html#setNetworkPreference(int)" rel="nofollow">https://developer.android.com/reference/android/net/ConnectivityManager.html#setNetworkPreference(int)</a></p>