Skip to content

kashiftufail007/Login-with-SQlite-

Repository files navigation

Login-with-SQlite-:heart: :1st_place_medal::heart:

Login Registration SQlite Detail

Here in this project you can store your Data in SQLite through Registration and then use this data as login, 💥

Easily Changeable and highly understandable Code 👍❤️

Project Detail

DataBaseHelper Activity for SQite Database detail ❤️🙂 ☺️

Create table user_detail(serial_number INTEGER  PRIMARY KEY AUTOINCREMENT, user_id INTEGER   , email_address text , user_password text, user_status INTEGER "

To insert in SQLite ✍️

public  void insert (Integer user_id , String email_address , String user_password, Integer user_status) 

To get all Data from SQLite ✍️

public Cursor alldata() 

MainAvtivity for Registation

Only Insert into SQLite if Both PASSWORDS matched and EMAIL not exist:writing_hand:

 if (s1.equals("" )|| s2.equals("") || s3.equals(""))  { 

               Toast.makeText(getApplicationContext(), "Fill upper Fields First ", Toast.LENGTH_SHORT).show();                

            }else if(!s2.toString().equals( s3.toString())) {

                Toast.makeText(getApplicationContext(), "Password Does not match", Toast.LENGTH_SHORT).show();

           }else {

                    Boolean check_email = db.check_email(s1);
                    if (check_email == false){
                        Toast.makeText(getApplicationContext(), "Email Already Exists ", Toast.LENGTH_SHORT).show();

                    }else

                        Toast.makeText(getApplicationContext(), "New User Added ", Toast.LENGTH_SHORT).show();

                        db.insert(0, s1, s2, 1 );
            }  

SecondAtivity For View Data ✍️

Cursor cursor = db.alldata(); 

LoginActivity for Login ☺️

Get Values one by one and Compare IF Condition ✍️

for (int i=0 ; i<cursor.getCount();i++)
 
 if ((ema.equals(cursor.getString(2).toString())) && (pass.equals(cursor.getString(3).toString())))

Author

Muhammad Kashif ❤️

License

Copyright © 2019-2020, Muhammad Kashif. Released under the MIT License.

More Projects 💪 💪 💪

Releases

No releases published

Packages

No packages published

Languages