The Scenario: My App has many activities. At the end the user uploads his all data in just one click.
The Problem: A problem might arise if the user is on the move and goes out of service(internet service / poor connectivity), then he/she couldn’t upload the data.
In this context I want to know what might be a best efficient approach.
I have thought of one approach. If due to poor connectivity / no service I will save the data locally in SQLite. Keep a thread alive when user opens the App next time to check if service/connectivity available. If yes, it will be uploaded instantly.
I will be eagerly waiting for your comments.
For learning how to upload data I recommend watching Google I/O 2012 – Making Good Apps Great: More Advanced Topics for Expert Android Developers : http://www.youtube.com/watch?v=PwC1OlJo5VM# from 16:43. It deals with efficiency and impact on battery life.
To summarize the video:
Do one large upload instead of several small uploads due to how the phone radio works, and try to minimize touching the network.
On a lower level do as user370305 said, try to upload the data, if there is no connectivity delay the upload for the next time the user opens the app or clicks the upload button.