Keeping a User Logged In

Put your problem here if it does not fit any of the other categories.

Keeping a User Logged In

Postby mercution » Mon Dec 08, 2008 10:36 pm

So I am developing an app where a user must sign in to access their account (app is a client side app for web services). I am having trouble on the idea of keeping a user logged in. I dont want to have a user to continue to keep logging in each time he opens the application but it is currently the case. I am not sure if this currently matters or not but each time i am changing screens I am using
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent activity = new Intent(Login.this, MusicPlayer.class);
  2.  
  3. Login.this.startActivity(activity);
  4.  
  5. Login.this.finish();
  6.  
  7.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

to change screens. When I do this am I basically destroying everything that has been done in this page? But more importantly is there a work around so that a user does not have to continually log in each time he opens up the application. :?:
mercution
Freshman
Freshman
 
Posts: 2
Joined: Wed Nov 12, 2008 10:24 pm
Location: Utah

Top

Postby mercution » Wed Dec 10, 2008 10:59 pm

Bump... I still need to get some ideas or assistance on this bad boy.

I recently found out how to pass information across activities:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. //Setting the information
  2.  
  3. Intent activity = new Intent(Login.this, MusicPlayer.class);
  4.  
  5. activity.putExtra("user", userObject); //can put many different things in for userObject
  6.  
  7.  
  8.  
  9. //Retrieving it from next activity
  10.  
  11. User user = (User)getIntent().getSerializableExtra("user"); //Returns an object so cast it
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


It is useful for different practices but obviously doesn't even begin to solve my problem.
mercution
Freshman
Freshman
 
Posts: 2
Joined: Wed Nov 12, 2008 10:24 pm
Location: Utah

Postby haden » Thu Dec 11, 2008 9:59 am

you can either have the credentials stored in the application preferences or in the database


You can read more here..

http://code.google.com/android/devel/data.html
haden
Experienced Developer
Experienced Developer
 
Posts: 74
Joined: Thu Sep 11, 2008 11:51 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests