Using AppSettings instead of LocalStorage - Burke Holland


#1

NativeScript does not have the often used Local Storage API, but it does have a very similar API called “ApplicationSettings” that can be used in almost the exact same way. In this video, we look at how to stringify, store and retrieve objects.


#2

what is the maximum storage capacity of AppSettings and is it secure ? @jen.looper Is it better than using localStorage ?


#3

LocalStorage is something exists only in browser environment. When you need something similar in a native app environment, you can use AppSettings.

It is as secured as LocalStorage.


#4

you misunderstood, when i was talking about localstorage i was talking about this plugin : https://github.com/NathanaelA/nativescript-localstorage

And now my quastion is, is there any alternative than AppSettings ?


#5

nativescript-localstorage plugin writes data to a JSON file in app data directory. It can actually help if you use any browser dependent JavaScript library that utilizes local storage apis.

There is again nativescript-securestorage plugin which can be used for more sensitive data. There is always one or other option, it’s upto you to choose based on the actual purpose.