Maintain login session in android app
|September 13, 2014||Posted by forumadmin under TechQns||
Whenever user login from android updating status of user at php server( i.e set status =1 ) and set status =0 when user logout from app. Now other usres will see in their app the user as logged in when status =1 . But when user uninstall application while he is logged in and install app again the user unable to login as server is not updated with status value i.e status value is remained status =1.
I have used following for session management -
- Shared Preferences
- File (Internal)
But both has limitation that shared preferences and file get lost on app uninstallation.When the user uninstalls your app, the system removes all your app’s files from internal storage.
If I go for external storeage I am not sure whether sdcard would remain , it may be changed or removed.
I also found an idea of maintaining tokens during sessions from this link
|Asked By – Yuvraj Kakkar||Read Answers|