Forbit sleep mode


my app using a stream to read/write infos to a server.
But as long as this stream is open, i would like to deactivate the sleeping modes of mobiles
(cause i only get the events after i wake up - which is too late).

Can y tell me how to do this? Thanks.

DisallowSleepMode in Manifiest file.

Or use background intent