I\'m having hard time trying to figure out how to use SharedPreferences to store the username in the phone and stay in session until logout. I also need to know how at the s
When the user logs in successfully, add the user's username to the SharedPreference for your application.
SharedPreferences settings = getSharedPreferences("MyPrefsFile", 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("username", username);
Every time the user opens the app, check to see if the "userID" preference is set. If it is then he is logged in. otherwise show the Login screen. When the user logs out, delete the "username" entry from the shared prefs.
I also need to know how at the same time its in session it will send the username out with the data the user click on within the listview
You will have access to the user's ID through that shared pref so you are able to use it whenever you need it. The Android framework does not do that for you but it's a simple task for you to do.