maybe this is NOT a b4a issue, but maybe b4a can do something...
My app is a b4xpages app
It is connected with a prog on my pc using sockets using a LOCAL NETWORK (internal router)
I send a "PING" toi the server every 10 seconds. If I detect a network error, I reconnect
all works OK, if I keep the mobile "active"
as the times passes, this is what happens
the app is running OK (ping OK)
after a while the mobile screen becomes dark
if continues running (ping OK)
after a minute the mobile screen becomes "black" (?)
my app stops pinging
the connection drops
btw: b4abridge v 2.66 itself DISCONNECTS too... so I guess my devices closes the IP connection?
I can guess the IP socket is sleeping... as if I run the app in debug mode, it stops sendind logs to the IDE...
this is an exaple of logs. with the "network changes"
IP address OK: 192.168.1.54
Logger connected to: Xiaomi Mi 9 Lite
--------- beginning of system
--------- beginning of main
05/03 16:27:36 Sono BACK in rete ip: 192.168.1.54
05/03 16:27:36 Sono in rete ip:192.168.1.54
** Activity (main) Resume **
05/03 16:28:12 Sono in rete ip:192.168.1.54
05/03 16:28:13 Sono OUT rete ip:fe80::e805:9dff:fef4:e567%dummy0
05/03 16:28:13 Sono OUT rete ip:10.168.184.91
05/03 16:28:17 Sono BACK in rete ip: 192.168.1.54
05/03 16:28:18 Sono in rete ip:192.168.1.54
05/03 16:42:58 Sono OUT rete ip:fe80::e805:9dff:fef4:e567%dummy0
05/03 16:42:59 Sono OUT rete ip:10.168.184.91
05/03 16:43:03 Sono in rete ip:192.168.1.54
05/03 16:43:22 Sono OUT rete ip:fe80::e805:9dff:fef4:e567%dummy0
05/03 16:43:23 Sono OUT rete ip:10.168.184.91
05/03 16:43:27 Sono BACK in rete ip: 192.168.1.54
05/03 16:43:36 Sono in rete ip:192.168.1.54
...
... SO my mobile goes in and out from local network, making things very hard - my app need to remain connected
Can I force to stay in network, e.g. maintaining a "keep alive" - I don't know... disabiling battery optimization for my app?
add: If the mobile is connected to the power supply (not powered only by battery), the issue does NON happen. I am always connected.
Thank you
My app is a b4xpages app
It is connected with a prog on my pc using sockets using a LOCAL NETWORK (internal router)
I send a "PING" toi the server every 10 seconds. If I detect a network error, I reconnect
all works OK, if I keep the mobile "active"
as the times passes, this is what happens
the app is running OK (ping OK)
after a while the mobile screen becomes dark
if continues running (ping OK)
after a minute the mobile screen becomes "black" (?)
my app stops pinging
the connection drops
btw: b4abridge v 2.66 itself DISCONNECTS too... so I guess my devices closes the IP connection?
I can guess the IP socket is sleeping... as if I run the app in debug mode, it stops sendind logs to the IDE...
this is an exaple of logs. with the "network changes"
IP address OK: 192.168.1.54
Logger connected to: Xiaomi Mi 9 Lite
--------- beginning of system
--------- beginning of main
05/03 16:27:36 Sono BACK in rete ip: 192.168.1.54
05/03 16:27:36 Sono in rete ip:192.168.1.54
** Activity (main) Resume **
05/03 16:28:12 Sono in rete ip:192.168.1.54
05/03 16:28:13 Sono OUT rete ip:fe80::e805:9dff:fef4:e567%dummy0
05/03 16:28:13 Sono OUT rete ip:10.168.184.91
05/03 16:28:17 Sono BACK in rete ip: 192.168.1.54
05/03 16:28:18 Sono in rete ip:192.168.1.54
05/03 16:42:58 Sono OUT rete ip:fe80::e805:9dff:fef4:e567%dummy0
05/03 16:42:59 Sono OUT rete ip:10.168.184.91
05/03 16:43:03 Sono in rete ip:192.168.1.54
05/03 16:43:22 Sono OUT rete ip:fe80::e805:9dff:fef4:e567%dummy0
05/03 16:43:23 Sono OUT rete ip:10.168.184.91
05/03 16:43:27 Sono BACK in rete ip: 192.168.1.54
05/03 16:43:36 Sono in rete ip:192.168.1.54
...
... SO my mobile goes in and out from local network, making things very hard - my app need to remain connected
Can I force to stay in network, e.g. maintaining a "keep alive" - I don't know... disabiling battery optimization for my app?
add: If the mobile is connected to the power supply (not powered only by battery), the issue does NON happen. I am always connected.
Thank you
Last edited: