Connect Android App To Database (Complete Register & Login Tutorial)




In the tutorial you will learn how to make a connection between a server and an android app. You will also learn how to send and get data from the database …

Original source


29 responses to “Connect Android App To Database (Complete Register & Login Tutorial)”

  1. null info is getting added to my database, and when I login/register, I get null for name, password and email. I'm getting an exception: Value Exception of type java.lang.String cannot be converted to JSONObject. Does anyone know how I can fix this?

  2. i get null value on my android studio, but when i try the php file on my web, the json value is working fine. I think my app cant get the value from the php. Any suggestion?

  3. Hi +Het Patel thanks for the great tutorial. I have a question when I using url 127.0.0.1 or localhost it will show the exception, but when I use 10.0.3.2 and click register It didnt happen anything. what should I do ?

  4. null info is getting added to my database, and when I login/register, I get null for name, password and email. I'm getting an exception: Value Exception of type java.lang.String cannot be converted to JSONObject. Does anyone know how I can fix this?

  5. +het patel ,i use my android phone to test,but it keeps showing "fail to connect to 10.0.2.2(port 80) after 3000ms" once i clicked on the register button.
    pls help~~!

  6. Hi Sir Het
    When login to show value in Home.java , I have error JSONException: Value of type java.lang.String cannot be converted to JSONObject . Why ??
    I checked login.php no have the error .
    How fix to solve it. ?
    help me please~~

  7. hello bro , u said to use 10.0.3.2 if i use android emulator . but what if i use my phone to run and debug the apps ? what should i use ? pls reply ASAP if anyone know , i need to fix it by tonight T^T

  8. Thanks! This is great. I do have a couple of questions though:
    1) How does the java code know that the `main_login()` function in the main.java file needs be ran after the 'login' button is clicked? I don't see an `event listener`, so I'm confused about this.
    2) In Main.java, within the 'protected String doInBackground(String… params)' function, why does the data in 'return data' get passed into 'String s' on the 'onPostExecute' function? Is it because they're within the same class, so the returned data from the 'doInBackground' function gets passed directly into the 'onPostExecute' function?

Leave a Reply