Storing data locally for both android and ios?


#1

Hello,

I am building an app which is for both android and ios. I need information about storing data locally for both the platforms and it will be good if its a common database. As per the reviews, localStorage does not seem to be good. Or just need information on best way of handling data storage locally??


#2

that depends on the data size.
If you have a lot of data, then I recommend you to use the Cordova Sqlite Plugin https://github.com/litehelpers/Cordova-sqlite-storage With that you have then a database.

If you have just meta data, then you can also use https://github.com/litehelpers/Cordova-sqlite-storage and https://ionicframework.com/docs/storage/ in combination.

If you have to crypt data, because of sensible data. For that exists also from the litehelpers a plugin:

Finally I don’t recommend the the local storage without the sqlite plugin. :wink:
But well that is purely a matter of taste, I love to work with the plugin.

Hope that helps you.


#3

So this can be used for both ios and android is it?


#4

yes also for Windows/MacOS if you want.


#5

Thats great. Thanks a lot :slight_smile:


#6

You can use dataService for locally storage, by using Json.Parse.