Our company is developing an android application that uses network communication to send GPS signals from devices. The devices are the same and they are all work tools, so we do not have to worry about battery draining, or etc. Currently the activity has a thread, which communicates with the server. The problem is that when the device is locked and it goes to sleep, the network communication breaks.
I've tried to put a partial wake lock to the onPause
method to keep the CPU on, and release the wakelock in the onResume
method, but it seems not to work. Any idea how to prevent the sleep, or keep flowless communication between the client and the server?