Some specific requests in my application need to go over MMS APN. This is achieved by using requestRouteToHost(TYPE_MOBILE_MMS, <specific host>). This usually works.
However, when the device is connected to a private Wi-Fi, that has no connection to the Internet, I can’t complete the preceding request, as requestRouteToHost required a resolved address (i.e. DNS resolved), and the Wi-Fi connection has no access to a DNS.
My question – is there a way for me to make sure a DNS resolve request goes through the MMS APN as well?
Solved:
You simply need to call startUsingNetworkFeature BEFORE you try to resolve the host.
That way, even if you’re on a Wi-Fi connection that has no Internet reachability, the device should get to a DNS.