Remove the delayed shipment of data to server
The annex shall retain the data on appengine c endpoint service. Maybe it's like the Internet broke down during work or the application started work when the Internet was gone.
We need to keep these data down and then send them on the Internet. I think there should be a liba on this.
This is now realized as a Service that starts to apply and starts a timer. Timer is watching if we send the connection, if we don't, we're signing up to update ConnectivityManager. CONNECTIVITY_ACTION
It's kind of working, but it's kind of fabulous. I think a lot of people have faced the need not to lose data without the Internet.
inna last edited by
The interaction with the server and the organization of the queue are two different topics, so the answers need to be found in different locations. I understand it's all right with a request for a server, and it's gonna be repeated if he didn't get away for some reason. Accordingly, it is necessary to keep the status (the indication that there is still data for shipment) and the data themselves.
We need to use a service to send. In service, we need to check the possibility of connecting (the presence of connections, the presence in doze mode) and try to implement it. If it's a failure again, we need to plan the launch again. AlarmManager can be used to re-launch the service. https://developer.android.com/training/scheduling/alarms.html )
There is also a need to remember the possibility that the phone will be overloaded between attempts. So it makes sense to catch intent. https://developer.android.com/reference/android/content/Intent.html#ACTION_REBOOT reporting rebooting, and planning to launch the shipment service.
Androids have to do that. https://developer.android.com/reference/android/accounts/AccountManager.html which can plan and synchronize in the background. But it's not easy to achieve, and it'll be overkill.