connection - Android Lollipop defaults to Mobile Data when Wi-Fi has not Internet access? -
android lollipop
seems default mobile data when wi-fi
connected has no internet access. know if officially documented somewhere?
we have application needs connect machines via wi-fi
not have internet. our customers reporting wi-fi
connection not work anymore, because phone automatically switches lte
.
my understanding phone still keeps wi-fi
connection uses lte
in addition provide access internet (lollipop-feature-spotlight-android-now-defaults-to-mobile-data-when-wi-fi-has-no-internet-access-signal-icon-adds-a-for-no-connection).
is understanding of feature wrong? , if so, there way force using wi-fi without internet? not find in particular in developer documentation.
any appreciated.
to extend on @ianhanniballake's answer, i've found binding network using connectivitymanager.setprocessdefaultnetwork() prevents roaming , allows full tcp access. thus, within onavailable() callback bind application process network rather opening connection particular url.
connectivitymanager connection_manager = (connectivitymanager) activity.getapplication().getsystemservice(context.connectivity_service); networkrequest.builder request = new networkrequest.builder(); request.addtransporttype(networkcapabilities.transport_wifi); connection_manager.registernetworkcallback(request.build(), new networkcallback() { @override public void onavailable(network network) { connectivitymanager.setprocessdefaultnetwork(network); } }
Comments
Post a Comment