web services - Android save login user details in application -
i web developer , new android , studying ... first step made user login system using php-mysql web services.
the application communicating web service pretty , check user exists. if user exists return user details if user exists.
my question in web application there session / cookie handling in android application ? eg if can save session not need login @ each , every time.
i sure there way because lots of apps working feature. since new android please advice bit.
not knowing correct word googling. "savepreferences".
thanks in advance
i think looking sharedpreferences. stores data persistently in (key, value) pair have check box @ login screen if check stores boolean
value
, username key
. when login screen , choose username checks value , if true
doesn't require password. assuming allow more 1 user login app.
however, if have 1 person logging in app device, send value web server when open app can skip login screen.
besides links docs provided above, here example in docs started
if in need of more robust sharedpreferences provides, @ storage options section of docs. hope helps
retrieve prefs
sharedpreferences prefs = this.getsharedpreferences("john smith", 0); saved= (prefs.getstring("loginsaved", false)); if (saved) // stuff here else // require login
Comments
Post a Comment