N nicieri Active Member Licensed User Longtime User Dec 11, 2017 #1 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Dec 12, 2017 #2 Is your service a foreground service? If the process is still running then ignoring battery optimization will probably won't help. Are you trying to reconnect after the connection breaks? Upvote 0
Is your service a foreground service? If the process is still running then ignoring battery optimization will probably won't help. Are you trying to reconnect after the connection breaks?