Best way to store data and tables in offline app?


#1

I’ve just started with Ionic so pardon me if my question is not in order. I want to make an app that people will use in villages to read data from electronic counters and store that data as well as their latitude and longitude inside the device till they finish their working hours, then they come back to their starting point which will have internet connection and synchronize all the data with an online/local database. Any advices? Thanks in advance, i am really loving Ionic and i hope i won’t give up on it because of limitations. Cheers!


#2

Simplest solution for the offline part: https://ionicframework.com/docs/storage/
I would then add a “I am online, please synchronize” button that takes this data and submits it to a server via a simple REST API where it is then saved in a normal (MySQL, Postgres) database.


#3

Thanks man, i will investigate how it works. Let me know if there is some example i could read code from :wink:


#4

The network information plugin can also recognize when connection status changes, so if your users go into airplane mode in the village, when they turn airplane mode off, the app can notice this and start the synchronization process on its own.


#5

Yeah but they would have to go to airplane mode manually then right?


#6

Not necessarily, if they’re going out into the boondocks where there is no data service.


#7

Ok i apologize. Thanks a lot for answers, i really appreciate it.