Android Question UDP listen in background

Gandalf

Member
Licensed User
Longtime User
Hello,

I need Android 8.1 device constantly listening for UDP packets in background. I tried to do exactly as in Background location tracking example, but no success. Service is not stopping but UDP packets are not received when device comes to sleep. Is there any way to make it working?
 

Gandalf

Member
Licensed User
Longtime User
Most of my target devices don't have google services... Is there any alternative of push notifications?
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
I have a cheap china tablet which works ok but after some time WiFi seems to be switched off (have to manually switch it on again). Maybe the network doesn't work anymore. You could "ping" a website via OkHttpUtils (simple request) and log if there's a problem after some time (UDP doesn't have any error handling or handshake).
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…