Android downlink data over Wi-Fi and uplink data over mobile network

Is it possible in android to route all incoming data traffic via WiFi and all outgoing traffic through a mobile network.

An answer was found on stackoverflow. How Wi-Fi and mobile data work simultaneously in android for an OBD2 device . But it routes data for only one host.

There is also a SuperDownload application that uses Wi-Fi and a mobile network to achieve faster download speeds. I am trying to do something like this.

In Android-WiFi and mobile network does not work at the same time. Is it possible to make it work by rooting the device? (SuperDownload requires root).

+6
source share
2 answers

It’s not easy, what would you do.

First you need to support both network interfaces, it’s possible, but it’s a hack because Android does not support it. To do this, you must enable

connectivityManager.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, "feature"); 

The name of the function is associated with your equipment; it must be enableHIPRI . The problem is that after you turn on the interface, it will turn off after a while, for this reason you must execute an HTTP request every 20-30 seconds to support it. Thus, the interface will remain on.

Add a static route to the route

 connectivityManager.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI, ipAddressInt); 

Where ipAddressInt is the address you want to connect to 3G. Routes usually go all over WiFi, so there is no problem for your GET (upload to WiFi), but you must add a route to download.

And now there are 2 problems,

  • firstly, so that in this way the 3G resolved DNS resolution, you can work with the IP address, but you must have a server with a static IP address,
  • Secondly, I'm not sure if it works on a specific port (this is the only idea that I have at this moment to do this ...).

Of course, you must implement another thread that supports the interface.

+1
source

I think this is impossible at all. Think about how your destination can find the answer path for delivery?

Let me explain, when you are trying to extract something from the network (for example, a web page), you should put your IP address and destination IP address in a packet and send it to the network (Wi-Fi or 3G), and the network will send it to the destination. When your answer is ready, the destination will change the process and place your IP address as the destination address and its IP address as the source and release it on the network. Again, the network using this information will find you and deliver the package to you. Thus, you can never send information to a network (for example, Wi-Fi) and receive a response from another network (for example, 3G).

Note. If all mid-tier routers find out about your goal (sending and receiving to two different networks), this will be possible. Currently, in some routing protocols, especially in border routers that are commonly used by governments, something like your goal allows you to overcome a limited data rate, for example. (more than 10/100 Gbit / s).

+1
source

All Articles