From the course: Writing Secure Code for Android by Infosec

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Activity: Implementing session management

Activity: Implementing session management

From the course: Writing Secure Code for Android by Infosec

Activity: Implementing session management

- [Instructor] Session Management. Activity. Implementing Session Management. In Android Studio, open an existing project and browse to your Student Activities. Go to Course Six and go to Session Management and select SignUpWithPrefs and open it. Now, this activity is very simple. What we're going to do is have the user put in a username and password, and it can really be anything. We're asking for email address, but it can be totally fake. We'll have them save it in shared preferences and we'll have them move away from the app. They'll background the app or they'll do something without logging out. When they go back to the app, the shared preferences will retrieve the data and the data will be right there. And that data will only be destroyed when the session is destroyed. So when they actually log out. We only have the main activity here. We set up a companion object, and in it, we're putting constants. And we know that in a companion object, we have to have constants. The first…

Contents