I am sending data to server by using HTTP post and successfully it fired at the server. Now In between sending the data and waiting for server response, suddenly Due to network problem my android device gets internet connection lost. In device m able to show an alert dialog of connection lost, but at server side the data was already processed and it was updated in database ie MySQL server But my android device does not know this bcoz till it did not get any response from server. How to resolve it.
Whether it could be done on server side or in android app and How?
How server would know that android phone is not getting the response till now ?
Any Idea .. Waiting for the answer???
For each request which is sent from device to server you should generate unique ID (check GUID for example)
then you send request with this id to server, if connection lost - trying to re-send with the same ID
on server side you have to implement check: if the query with ID was processed/inprocess/new
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With