Android Question REQUEST_IGNORE_BATTERY_OPTIMIZATIONS ?

nicieri

Active Member
Licensed User
Longtime User
Hi, I have an App.. that is a service (TCP Connection)..

My service still working all time... in some celphones (newest),.. The TCP Connection is broken after some minutes...


"Failed to connect: (SocketTimeoutException) java.net.SocketTimeoutException: connect timed out"

The server is working good, others celphones are connected (all works good.. but for some reason the newest phones lost the connection).


I think that the phone is blocking the connection.. maybe for a battery optimization..

How can I do for the cellphone ignore my app from battery optimization?


I tried this: https://www.b4x.com/android/forum/threads/request_ignore_battery_optimizations-problem.73039/

But give me some errors..

Can anyone help?

Thanks.
 
Top