Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Login Authentication

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 257
    Comment on it

    Below i have written the code for Login Authentication, this code will check that weather the entered name and password are there in database or not. The following code will return true boolean value if the entered name and password exist in database and will return false boolean value if not.

    public boolean login(String username, String password)throws SQLException
    {
        SQLiteDatabase db=this.getWritableDatabase();
        Cursor cursor= db.rawQuery("Select * from "+TABLE2_NAME+" where email=? AND email_type=?",new String[]{username,password});
        if(cursor!=null)
        {
            if(cursor.getCount()>0)
            {
                return true;
            }
        }
    return false;
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: