Closed matttbe closed 6 years ago
Can you direct on how to integrate this code to the existing code i.e. How to replace the deprecated startUsingNetworkFeature with this code?
Hi @tarunmangla,
Two techniques are used to maintain active both LTE and WiFi connections:
Note that it is possible to check the version of Android in the code:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
// see https://developer.android.com/reference/android/os/Build.VERSION_CODES.html
}
@tarunmangla can you please specfy the code how to implement on that in below code.
public void setMobileDataActive(boolean mEnabled) {
if (Manager.DEBUG)
Log.d(Manager.TAG, "setMobileDataActive " + new Date());
ConnectivityManager cManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (isMobileDataEnabled() && isWifiConnected() && mEnabled)
cManager.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
"enableHIPRI");
else
cManager.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
"enableHIPRI");
}
This should now be supported thanks to the new branch from @qdeconinck : https://github.com/MPTCP-smartphone-thesis/MultipathControl/tree/marshmallow
It is currently not planed to support Android 5 but it's possible that we will have to change a bit the way to use the cellular interface when the WiFi one is enabled.
Let's write here this tip to not forget it :-)
Src: http://stackoverflow.com/a/28696825