Android Wifilock - How about blocking data access?

If there is wifiLock for acquiring Wi-Fi and turning it on, even when the phone goes into standby and sleep mode, is there a copy for mobile data access?

You see, now everything is going well if the user is connected to Wi-Fi. But somehow, using mobile data access, and when the phone is idle, it seems that it disconnects the connection. Any ideas?

+4
source share
1 answer

Mobile data does not go into sleep mode. However, if your socket remains open and has not been used for some time, it may be disconnected. To do this, C2DM (and, presumably, GCM) had to send a heartbeat every 30 minutes or so to make sure that the open socket connection on Google's servers remained open.

+5
source

Source: https://habr.com/ru/post/1446757/


All Articles