3G & Wi-Fi at same time

250 views
Skip to first unread message

Ricardo Silva

unread,
Mar 2, 2010, 8:35:54 AM3/2/10
to Android Developers
Hello,

here is a solution (only for testing and research, not for product) to
have the cellular data and wifi at the same time.

Warning: need root

1. pull build.prop from system

adb pull /system/build.prop .

2. Change ro.built.type property:

from: ro.built.type=userdebug (on ADP1)

to: ro.built.type=eng

3. Add property:

cm.test.mode=true

4. Remount system:

adb root
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
exit

5. Push build.prop:

adb push build.prop /system

6. reboot :)

Some one knows if is possible to change the source code of the
ConnecitivityService.java and push to Android system (without install
a new image)? I think that is possible compiling a new core.jar and/or
ext.jar, correct?

cya

Tanmay

unread,
Mar 14, 2010, 7:06:41 PM3/14/10
to Android Developers
Hi,
This seems to be what I am looking for. However, just to confirm, I
will give a short description of what I am trying to do:
I am trying to use Wifi for an internal WLAN connection (which would
not be accessing the internet) , and a 3G network to give me access to
the internet at any time.

Hope I am going down the right track. I will try doing these changes
and seeing how it goes.

Please let me know if these are not required/ will not solve the
problem I described.

Thanks

3, 2:35 am, Ricardo Silva <ban...@gmail.com> wrote:
> Hello,
>
> here is a solution (only for testing and research, not for product) to

> have the cellular data andwifiat the same time.

Ricardo Silva

unread,
Mar 14, 2010, 8:38:51 PM3/14/10
to android-d...@googlegroups.com
Hi,

See the route table, because the default route will be the WLAN, I think. Because is the normally the preferred network (changes to 3G). Otherwise, it will work.

Regards,
Ricardo Silva



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-develop...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Tanmay

unread,
Mar 15, 2010, 3:29:29 AM3/15/10
to Android Developers
Hey,
Thanks for the reply.
You reckon I should have a look at the routing table before making
these changes or after? Yes, from the forums I have seen that Wi Fi is
the preferred link. However, I am not sure whether it switches to 3G
in case it cannot connect to the internet via the Wi-Fi network which
is connected, but is purely local and cannot take it to any website.

Cheers
Tanmay

> > android-develop...@googlegroups.com<android-developers%2Bunsubs cr...@googlegroups.com>

Ricardo Silva

unread,
Mar 15, 2010, 5:46:09 AM3/15/10
to android-d...@googlegroups.com
After the changes.

Yes, Android switch to 3G if can not obtain a default gateway (from DHCP or statically configured) in the Wi-Fi network. And then will use 3G for Internet and Wi-Fi for the local addresses.

Then, a easy way is to configure the WiFi interface with a static IP (like 192.168.0.1, same address range as the Wi-Fi network) and a mask (255.255.255.0), and leave the gateway and DNS fields empty. Then confirm if the route table has the 3G network as default gateway. Use the command netcfg in the ADB to see that (in Hex, the default gateway is all zeros) or use the busybox for Android which have the normal route command from Linux.

Regards,
Ricardo Silva

Tanmay

unread,
Mar 17, 2010, 4:35:09 PM3/17/10
to Android Developers
Thanks a lot for the help man. I will try to do this during the
weekend or next week... n let u know how it goes.

Many Thanks
Tanmay

> > > > android-develop...@googlegroups.com<android-developers%2Bunsubs cr...@googlegroups.com><android-developers%2Bunsubs

vikky

unread,
Apr 30, 2010, 1:55:16 AM4/30/10
to Android Developers
Hi..
can you please tell me..
how can i switch from one mode to another mode, It's my requirement.
I want to switch from Wi-Fi network to 3G network by program.

I know Wi-Fi is first choice for android but
in my project user could connect through any of available networks.
The choice is purely depends upon user,
through list of radio buttons...like
Wi-Fi
GPRS
EDGE etc.

please reply me,
Many thanx..


On Mar 15, 2:46 pm, Ricardo Silva <ban...@gmail.com> wrote:
> After the changes.
>
> Yes, Android switch to 3G if can not obtain a default gateway (from DHCP or
> statically configured) in the Wi-Fi network. And then will use 3G for
> Internet and Wi-Fi for the local addresses.
>
> Then, a easy way is to configure the WiFi interface with a static IP (like
> 192.168.0.1, same address range as the Wi-Fi network) and a mask
> (255.255.255.0), and leave the gateway and DNS fields empty. Then confirm if
> the route table has the 3G network as default gateway. Use the command
> netcfg in the ADB to see that (in Hex, the default gateway is all zeros) or
> use the busybox for Android which have the normal route command from Linux.
>
> Regards,
> Ricardo Silva
>
> > > > android-develop...@googlegroups.com<android-developers%2Bunsu...@googlegroups.com><android-developers%2Bunsubs
> > cr...@googlegroups.com>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-d...@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-develop...@googlegroups.com<android-developers%2Bunsu...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages