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 Studio - REST API Basic Authentication

Shows how to login and interact with a Rest API on a remote server with an Android app. Methods to receive JSON data are also taught. Video contains English audio. Source code available at:

Find Out Who’s Tracking You Through Your Phone

Did you know that anyone can get your personal information and read your private messages? We’ve gathered the most useful codes for smartphones all in one video, together with some instructions on

Makeup Mistakes to Avoid | Ali Andreea

Hi guys, So a lot of you here looove makeup. You see makeup gurus all over the world doing their makeup and looking flawless on camera so you decide to invest in some good quality products. Then you


  • Johndavid Mao
    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
  • Abdelgader ahmed ali
    I like your accent, Thank your for Tut
  • Marcos Evaldt
    Worked ! Thank you Filip!
  • Ricardo Caldas
    FINALLY A GOOD VIDEO! Thanks bro.
  • Nev Mcalbason
    I am getting {"error":" wrong password"} from Postman any ideas because im stumped