I am new to mobile development and still have much to learn. I have written an Android application that collects user data in SQLite database locally. I would like this data to be uploaded separately to users actions, which means:
- When the user is using the application, all of the data is stored locally,
- If the user has internet connection, data can be uploaded immediately to data server (no problem about the server side, php scripts are already written for data insertion),
- If the user has no internet connection, the application will wait for any connection and then upload the data.
I would like to know, what is the best approach to do this - is it any kind of service running in the background, or anything else? I have read about services only in tutorials, so I don't know exactly how to deal with them and if I should even bother writing them, to achieve what I have mentioned above?
Regards.