Depending on which version of Android you are planning and which version of PhoneGap you are using, you should use one of the built-in offline storage mechanisms available in the browser. These include localStorage and WebKitSQLite.
There is also a fantastic open source library in which you can use the abbreviations of any particular autonomous storage engine and allow interchangeable base storage adapters and provide a single unified key / value for the interface. The library is called Lawnchair - check it out!
So, at boot you should create an instance of Lawnchair and see if your saved user settings exist:
function onLoad() {
myStore = new Lawnchair();
myStore.get('login', function(i) {
if (i == null) {
} else {
}
});
}
, Lawnchair, , PhoneGap :
function login(username, password) {
if () {
myStore.save({key:'login',value:{username:username, password:password}});
} else {
alert('Could not log you in!');
}
}
, , - get() key , save(). , .
, !