This is a migrated thread and some comments may be shown as answers.

Persistent data store. What should I use?

1 Answer 165 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Young
Top achievements
Rank 1
Young asked on 26 Nov 2013, 08:16 PM
Hi, I'm very new to hybrid app development using Kendo Mobile. Here's what I'm trying to do...

1. pass username/password encrypted token to API server and get api_key
2. Store api_key on mobile device somewhere and use that key to authenticate every http request to the API server.

Now, where should I store the api_key?

I'm thinking of storing that api_key in LocalStorage (https://github.com/kendo-labs/kendo-plugins/blob/master/Framework/kendo.data.localstoragedatasource.js). But how does this work when converted as Android or IOS app?
Will it still use localStorage? or convert to some other datastore that I'm not sure of in native world?

Any recommendation? or best practices?
*ps: api_key should be persistent even when closing the native app, so that user don't need to login again everytime they open the app.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 28 Nov 2013, 03:34 PM
Hi Young,

Using localstorage is a good choice if the user should not authenticate everytime. LocalStorage (being HTML 5) is widely accepted and supported on both Android and iOS. The js to native wrapper that is used in Icenium (Cordova) allows for easy access to it via the window object. Check this help article for more information.

Regards,
Steve
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussions
Asked by
Young
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or