I’m making an app that is essentially a web form. I fill it out and send it to a website to be processed. But I only want it to send the data when connected to wifi.
I was thinking of putting the data into a tinyDB then running a check for wifi immediately. If connected it would submit the form and delete the db entry. I’d probably also run a check when the app is loaded and closed. It’s important that I don’t lose the data.
Is there a better way to do this?
if the form is small, you may not even need a db, you could just use SharedPreferences
http://developer.android.com/guide/topics/data/data-storage.html#pref , unless you have multiple rows of the user answering again and again then this might not be the best solution
here’s some network check code if you need it
not sure if you need this, you may already know how to do this or have it figured out