1. Arjun Mr's Avatar
    I am trying to develop an application in which a login is added. But i am stuck with the following problem:

    1. How can i detect whether a user has exit from the application(once accessed) without loggedout.(say if he exit the app without clicking the logout button)

    2. If it is not possible, the user can access the application from any android phones with the same user name and password. But that shouldn't be allowed in my application.

    3. Please provide any suggestions for the same.
    05-09-2016 07:41 AM
  2. acommoner's Avatar
    1. When a user exits an application, your Application, Activity, and Fragment classes will go through their general lifecycle calls (Activity | Android Developers), so if you want to do anything at these moments, just implement those methods.

    As for keeping a user logged in, you'll need to store the user's credentials somewhere after they have logged in, and then when the app starts up again, grab the credentials and use them again if they've already been entered. See this stack overflow post for a discussion: google app engine - Best place for storing user login credentials in Android - Stack Overflow

    2. If you're looking at cross-device login, you'll need to store login information on a server or online db somewhere, and then verify it when the user goes to log in. To make it simpler, you can also use login with Facebook/Google+/Amazon Cognito to make it simpler & not have to do everything yourself.
    05-09-2016 12:24 PM

Similar Threads

  1. Replies: 7
    Last Post: 05-12-2016, 03:29 AM
  2. Why is there no app for internal sound recording?
    By AC Question in forum Ask a Question
    Replies: 2
    Last Post: 05-09-2016, 10:54 AM
  3. Google Plus & Google Photo App
    By AlliGe in forum Ask a Question
    Replies: 2
    Last Post: 05-09-2016, 08:53 AM
  4. HTC ONE V won't detect TalkTalk SIM card ?
    By AC Question in forum Ask a Question
    Replies: 1
    Last Post: 05-09-2016, 07:01 AM
  5. Need help with screen lock app
    By ditendra in forum Ask a Question
    Replies: 0
    Last Post: 05-09-2016, 05:46 AM