My app HHA-EVV does clock in and clock out for a home care agent. On clock in / clock out the app sends location and timestamp back to the server. If there is no Internet the data stored in the database. The next time user starts the app right after login the app collects the all unsent info and if Internet is Ok, sends it to the server. But there is a problem. Agent did clock out, didn't have Internet at that time, the info stored in the database and he exited from the app. The next time he started the app 3 days later. If it's a Friday and he returns to the app 3 days later it's already next week and he won't be paid for the days he didn't have Internet even though he did nothing wrong.
I was thinking about creating another app that will constantly run in the background and every hour will check if there is something unsent and if the connection Ok - send it. But as far as I remember - Google Play market doesn't allow background apps anymore. And there is another problem - let's say this background app sends the info to the server and at the same time user started HHA-EVV app which is after login sees also that there is unsent and also will try to send it - it will be disaster.
Maybe we can rise a flag but it's also not reliable solution.
An ideas?
Thanks.
I was thinking about creating another app that will constantly run in the background and every hour will check if there is something unsent and if the connection Ok - send it. But as far as I remember - Google Play market doesn't allow background apps anymore. And there is another problem - let's say this background app sends the info to the server and at the same time user started HHA-EVV app which is after login sees also that there is unsent and also will try to send it - it will be disaster.
Maybe we can rise a flag but it's also not reliable solution.
An ideas?
Thanks.