Login/Register Screen In Android Using MYSQL, PHP, JSON PART 1/2

Login/Register Screen In Android Using MYSQL, PHP, JSON PART 1/2
In this android tutorial, i show how to create a simple user registration/login screen.
Github project: https://goo.gl/DOm7pR
Part 2 - https://www.youtube.com/watch?v=pFGNtINmEBQ

☑ Visit fb page: 

RRelated Posts

Android - Get GPS location via service

In my previous tutorial (https://www.youtube.com/watch?v=QNb_3QKSmMk) i explained how location services are working. By popular demand, i decided to make this tutorial to show the implementation of


  • Aprylian Maulana
    hi, i got some problem here. it's run correctly when i created new email and password and show "account created" on the postman, but when i clicked the send button again, why "wrong password" was show up, not the "welcome" message ? can you or anybody help me to solve this problem? i'll be very thankful
  • Hiedeline Paule
    Parse error: syntax error, unexpected 'function_construct' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in C:\xampp\htdocs\lastna\user_control.php on line 12 HOW TO FIX THIS ERROR.THANKS
  • mani mathi
    nice video
  • Tim Neto
    I'm from Brazil and my english is median, but i understand by the way that you speak very well. You speak english very good. Congratulations for the video and for the speak. Bye!
  • Johndavid
    Thank you so much: your explaination is very clear, and easy to understand, I hope you will do more video about android App
  • saher javed
    i am not getting message " wrong password" when i changed the password what i am doing wrong ??
  • Alastair Greener
    Thank you
  • nagasai m
    everythings works fine..but when i click on signin or register button it is not working i mean not showing any activity.!!
  • Muhammad Ali Khalid
    I want you Help in your android Login&register video.
    I perform as is it but i face an error can you see it. please, it's bundle of thanks. Kindly Help me...
  • Denzkie Pureboiz
    thank you for this!!! you helped me a lot... LIKED and SUBSCRIBED
  • Bacem Smiri
    Thanks for your tutorial ! but can you add how to make a session using shared references please ? waiting for your response
  • Jose de Jesus Becerra Vazquez
    Hi, how can i get fb name , email to save in mysql db?
  • Edson Cardoso
    I got it but I used PDO, congrats for the video.
  • CADEAU Lucmann
    what is the name of application u used for post request pls?
  • dhaval gondaliya
    thank you....
    good video...
  • SANGWA Emmanuel
    This is the best Tutorial I have ever got. Well explained, Thank you Philip. You
  • Arjun Nurdin
    Thanks Bro ..
  • sonu thapa
    provide rest api link
  • Pablo Maruk
    Just one comment about it.
    I know the intention of the video is to explain the android http connection BUT
    In the php scrypt there is a little error to be treated.
    If you try to create a user with same email and different password it works.

    For those trying this video I suggest to implement a check to the email
    If email exists dont execute query insert new user, if you do, you replicate the user but with a different password.

    My solution:

    public function does_user_exist($email,$password)
    $query = "Select * from users where email = '$email' and password = '$password'";
    $result = mysqli_query($this->connection, $query);
    if(mysqli_num_rows($result) > 0)
    $json['success'] = 'Welcome ' . $email;
    echo json_encode($json);

    $query = "Select * from users where email = '$email'";
    $result = mysqli_query($this->connection, $query);
    if(mysqli_num_rows($result) > 0)
    $json['Not Possible'] = 'This email already exists ';
    echo json_encode($json);

    $query = "Insert into users(email,password) values ('$email','$password')";
    $is_inserted = mysqli_query($this->connection, $query);
    if ($is_inserted == 1)
    $json['success'] = 'Account created, welcome ' . $email;
    $json['error'] = 'Wrong password';
    echo json_encode($json);
  • Pablo Maruk
    Congrats, mans.
  • Zelimir Skopljak
    Hi filip, i need some help for my project (java). Can I send you a private message?
  • Neelesh Kumar
    Where to put these php files?
    I am using SUBLIME TEXT..Where can i put the files in order to proceed furthur?
  • llamafan 123
    finely a good explained video
    thanks man keep up the good work😀👏👏
  • Sung Yung
    Excuse-me , i followed your tutorial step by step , i applied the same PHP code but when i tested it on the postman application , it didn't work and i wanted to know what kind of problem could it be by posting this comment , I've tried to figure it out and i found nothing , so, would you mind helping me ? it's a kind of an emergency and I'll be very thankful.
  • Robscientist
    in the postman app i get an error, " Unexpected 'H' ". does anyone know what to do ? please i need help, it's very important
  • Paulino Trejo
    Hi I'm from Mexico I was doing this example but I do not really know the truth, I do not understand English, I do not know if I missed something, but I'd like to know what I can do and run the app and the database is fine but I can not get it to run The query when I press the button nothing happens.
  • mohammadalijasiar
    can i have that database i m having problem with creating this
  • Perkha Ahmad
    plz reply must
  • Perkha Ahmad
    thank you sir but builder post ???? i dont understand ??? what is it???
  • Joshua Gomez
    Very Helpful tutorial. thanks
  • Taha Imran
    which tool u used fir running php file
  • Algnebe
    is these any dependencies that i have to add in php project for json and db( iam new to php)
  • rajkumar mishra
    Warning: mysqli_execute() expects exactly 1 parameter, 2 given in C:\xampp\htdocs\1\12.php on line 16
    Warning: mysqli_close() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\1\12.php on line 23

    don't know where i m going wrng jst can u sort it ???
  • munashe onwell jonga
    My Login or Register does nothing, its not taking me to the next Activity
    what application are you using? I mean where are you writing the codes?
  • Sanket Phulpagar
    I understand the coding part but how you design the layout for user login and password ..
  • Santanu Mukherjee
    Voila! It Worked successfully
  • eldrin rioveros
    hi sir! How can i know the local address that i will put in postman? thanks a lot :)\
  • ευη δημητροπουλου
    i get blank page at postman...does anyone know, why this happening;
  • Prabhu ki Leela
    bro i know php and mysql very well but problem is how to use them with android. i developed many applications using them but now i want to develop android aap with this.. please help
  • telmo lourenço
    Hello, thank you very much for your videos. When using the postman app, take a blank page, what can it be? thank you
  • Anmol Karki
    i tried using ur php files from Github but there is a problem of "Unexpected<" please help
  • Riyen Bueno
    When i'm trying to do it on postman FYI * i tried to used your files from github and i also changed the table name and it always saying that i have unexpected '<'' :(
  • amulya gm
    can i do this without xampp? how to connect to the database in phpmyadmin without using xampp?
  • shahrezza777
    what the software name that you use to try the post method on php file?
  • Pavle Vojinović
    When I test it with postman I get error "Unexpected '<' ". What it could be? Please help!
  • kenneth gomad
    is there possibly to send me a link the full php file you made please as it make some errors that i did not see carefully due on vision
  • sai tharun
    Hi Filip,
    in this tutorial you created a php script that contains mysqli_connect() function
    whose query goes like this "
    $conn = mysqli_connect("server_name", "username", "mysql_password","db_name");.
    by using above method How can we connect to multiple databases of webserver as you mentioned only single database in the query.
  • Ben Mow
    Thank You so much :D It helps me a lot :D I hope you continue doing helpful tutorials
  • Hero Nguyen
    why i can not post the data on localhost although I have to follow the steps C: \ appserv \ www \ test \ user_control.php