I have an app which is used to connect to a service running on the user's home PC.
There are two 'simple' scenarios...
I'm now faced with a more complex scenario which is when the user is at their place of work and their device detects/connects to their office WLAN and there is no route to the outside world.
The problem is that even if they have both wi-fi AND mobile internet enabled on their device, the wi-fi interface will normally be used in preference to the mobile internet interface when any app attempts to connect to the internet.
So the question is, can I somehow bind to the mobile interface and make an outgoing connection even when the wi-fi interface is taking priority? If so, any pointers to information on how to achieve this would be useful. Thanks.
This is where I would start digging. ConnectivityManager.requestRouteToHost
The primary responsibilities of this class are to:
Monitor network connections (Wi-Fi,GPRS, UMTS, etc.)
Send broadcast intents when network connectivity changes
Attempt to "fail over" to another network when connectivity to a network is lost
Provide an API that allows applications to query the coarse-grained or fine-grained state of the available networks
I'd also try grep'ing over the AOSP code to see where and how it is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With