GiLL
GiLL

Reputation: 354

How to add remember functionality in native app based on jqm and phonegap for next start up?

I create native mobile app of my website using jquery mobile and phonegap.Posts of website creates by different authors. So My app start page contain list of authors which can filterable,app users can select the author from list and posts written by that author displyed through app.my app some like similar to that web app

i wana to add functionality: once user select author.app remember the selected author for next start up and display all posts of author directly in next start up. i have no idea how i proceed.is some cookie based approach available for native app or there is some jqm and phonegap plugins available for that task. if anyone knows tutorial links for such task it will be great. thanks in advance.

Upvotes: 0

Views: 52

Answers (1)

Chris
Chris

Reputation: 580

Not sure what you tried already, but you can use localStorage - which is available also in cordova/phonegap. You save items (strings) as follows:

localStorage.setItem('author', favouriteAuthor);

and read it on startup with:

if(localStorage.getItem('author')!=null) favouriteAuthor = localStorage.getItem('author');

Hope that helps

Upvotes: 1

Related Questions