Maintaining user session in Android

android, social-networking

Solution

try

public class Session {
private static String sessionId;
private static String userRole;

public static void setSessionId(String sessionId) {
    Session.sessionId = sessionId;
}

public static String getSessionId() {
    return sessionId;
}

}

Use this class and import it in every other activity. You can define your own functions to maintain your specific session data

Problem

I am trying to make social network application for Android. My question is how to maintain user session when user logs in? Please help me to find the solution for the above question.

Original source