问题
hi friends i am a mobile developer. So far i have worked in iPhone apps and android apps. Now i am working in Phone gap based apps for iPhone and Android mobiles.
Now my problem is in my app i have a log in page where i have to enter the username and password and i return i use to get a unique is and token which i have to use for the whole app. If the app gets closed and opened after a long time i want this to be remained same.
For this in ios apps we use a method called UserDefault method and whereas in Android apps we have a default method called SharedPreference. In that way is there any default method for Phonegap or i have to use only database.
Currently i am writing a javascript for my phone gap apps, pls give me any suggestion.
回答1:
One option is local storage. Here is a tutorial on using local storage with PhoneGap.
来源:https://stackoverflow.com/questions/7721614/how-to-store-a-value-in-phonegap-apps-any-way-other-than-database