Action On Device Wake Up to Re-establish Socket Connection

133 views Asked by At

I've built an Android application using Delphi 10.4. In it, I have an SQL Server connection using an SDAC database connection.

My issue is when the device goes to sleep, the network connection suspends. And when I wake the device up, the connection with the SQL server does not re-establish until I ping it or try to fetch some data, etc.

What I'd like to do is add an awareness in my application of when the device wakes up to immediately perform an action. My action would be to ping the server to wake it up.

Is there a way to do this? The only thing I can find is the ability to lock the device from going to sleep, but I don't want that because it would decrease my battery life. I just want the app to know when the device is woken up.

0

There are 0 answers