Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As I understand it's not possible to get 3g and WiFi simultaneously connected without modifying Android platform source code (at least versions 2.3 and 4). The main problem is hardcoded priorities of connections defined in <a href="https://github.com/android/platform_frameworks_base/blob/gingerbread-release/core/res/res/values/config.xml" rel="nofollow">frameworks/base/core/res/res/values/config.xml</a>:</p> <pre><code>&lt;!-- This string array should be overridden by the device to present a list of network attributes. This is used by the connectivity manager to decide which networks can coexist based on the hardware --&gt; &lt;!-- An Array of "[Connection name],[ConnectivityManager connection type], [associated radio-type],[priority] --&gt; &lt;!-- ^^^^^^^^^^---------- Connection priority --&gt; &lt;string-array translatable="false" name="networkAttributes"&gt; &lt;item&gt;"wifi,1,1,1"&lt;/item&gt; &lt;item&gt;"mobile,0,0,0"&lt;/item&gt; &lt;item&gt;"mobile_mms,2,0,2"&lt;/item&gt; &lt;item&gt;"mobile_supl,3,0,2"&lt;/item&gt; &lt;item&gt;"mobile_hipri,5,0,3"&lt;/item&gt; &lt;/string-array&gt; </code></pre> <p>This config.xml is then read by <a href="https://github.com/android/platform_frameworks_base/blob/gingerbread-release/services/java/com/android/server/ConnectivityService.java" rel="nofollow">ConnectivityService</a> which is subscribed to connect/disconnect events. And in connect handler it decides what it should do with other connections:</p> <pre><code>private void handleConnect(NetworkInfo info) { //------------8-&lt;-------------------------- // if this is a default net and other default is running // kill the one not preferred if (mNetAttributes[type].isDefault()) { if (mActiveDefaultNetwork != -1 &amp;&amp; mActiveDefaultNetwork != type) { if ((type != mNetworkPreference &amp;&amp; mNetAttributes[mActiveDefaultNetwork].mPriority &gt; // ^^^^^^^^^ --- 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-&lt;-------------------------- </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload