0

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.

4

1 回答 1

1

不确定您已经尝试过什么,但您可以使用 localStorage - 在 cordova/phonegap 中也可以使用。您按如下方式保存项目(字符串):

localStorage.setItem('author', favouriteAuthor);

并在启动时阅读:

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

希望有帮助

于 2013-09-28T17:22:30.337 回答