Store big data in app


#1

when app starts first time I get json from server and I dont want to send requests every time i go to another page, I want to get data once and store somewhere and use it before app is live (before logout or closed)

I know how to store strings or number but how about this?


#2

Use sqlite or file system apis?


#3

I think you can use app-settings and store object in it,
https://docs.nativescript.org/cookbook/application-settings


#4

I see only setBoolean, setString and setNumber, where did you see object?


#5

app-settings are recommended to use only when your data is very minimal. Consider using file system or local db for storing big amount of data.

You may use nativescript-localstorage plugin which internally creates JSON files to hold your data, you can directly pass your object to the setItem method.

If you really wish to use app-settings, Use setString and stringify your object on set and parse it back on get.


#6

I think i go for localstorage