How to have the 4G connection always on?
Whenever there is a configured and saved Wifi available the phone disables 4G. This causes problems for apps that have long TCP connections (ssh, messengers, etc.). Connecting back to 4G takes a lot of time, and I would rather have the small battery drain. Also, for some reason Android apps (Whatsapp) don't seem to use the Wifi (or there is no connectivity change broadcast or something).
Is there a configuration file that I can edit to have 4G always on?
I'm not sure if I understand you correctly. You should just be able to disable Wifi on the phone completely and it should keep the connection over the mobile network (4G) if there is a signal.
Venty ( 2016-10-21 12:28:28 +0200 )editI want to use the Wifi because it is sometimes faster (poor indoor coverage etc.). Yet, I don't see a point in disabling the 4G just because there is Wifi. For example, Android typically does not disable cellular data when it is connected to Wifi (at least not in recent versions).
There can also be differences in service sets, for instance, the other network could allow me to access certain services, like backup over WLAN at home. Also, the WLAN or PS-data might not support IPv6 (I have IPv6 in some WLANs and always in PS-data).
Managing such things by hand is frustrating when all I need to do is to disable this dis-functionality. (maybe add some iproute rules & tables as well).
hupiukko ( 2016-10-21 13:03:08 +0200 )editWhat is the advantage of keeping cellular internet running? if the default route changes for your service then it still has to reconnect. And btw. that is clearly not a bug, its a feature request. I can tell for sure that until Android 6, cellular internet is turned off when wifi goes on and it provides a working internet access. Simply because it doesn't make sense to keep it running (see above)
bomo ( 2016-10-22 23:24:28 +0200 )editEver heard of multiple routing tables? Example using rule based routing:
echo '200 wifi' >> /etc/iproute2/rt_tables; echo '201 gprs' >> /etc/iproute2/rt_tablesip rule add from <wifi_iface_addr> table wifiip rule add to <wifi_iface_addr> table wifiip rule add from <gprs_iface_addr> table gprsip rule add to <gprs_iface_addr> table gprsBoth tables need to have default routes and associated devices as well.
Also, reconnecting to 4G takes ages. Reconnecting also happens on the worst moment when I'm walking to a bus stop and need to check schedules etc.
hupiukko ( 2016-10-23 21:57:57 +0200 )edit