As I understand it, it is impossible to connect 3g and WiFi simultaneously without changing the source code of the Android platform (at least versions 2.3 and 4). The main problem is the hard-set priorities of the connections defined in frameworks / base / core / res / res / values ββ/config.xml :
<string-array translatable="false" name="networkAttributes"> <item>"wifi,1,1,1"</item> <item>"mobile,0,0,0"</item> <item>"mobile_mms,2,0,2"</item> <item>"mobile_supl,3,0,2"</item> <item>"mobile_hipri,5,0,3"</item> </string-array>
This config.xml file is then read by ConnectivityService , which is signed to enable / disable events. And in the connection handler, he decides what he should do with other connections:
private void handleConnect(NetworkInfo info) { //------------8-<-------------------------- // if this is a default net and other default is running // kill the one not preferred if (mNetAttributes[type].isDefault()) { if (mActiveDefaultNetwork != -1 && mActiveDefaultNetwork != type) { if ((type != mNetworkPreference && mNetAttributes[mActiveDefaultNetwork].mPriority > // ^^^^^^^^^ --- From config.xml mNetAttributes[type].mPriority) || // ^^^^^^^^^-------- From config.xml mNetworkPreference == mActiveDefaultNetwork) { // don't accept this one if (DBG) Slog.v(TAG, "Not broadcasting CONNECT_ACTION " + "to torn down network " + info.getTypeName()); teardown(thisNet); return; //------------8-<--------------------------
source share