About the author

Akshay Raj

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *

88 Comments

  • Hello It is not sending Mail on live host. Pls help Verification and reset password. I am stuck. But i receive the otp on phpmyadmin

  • I’m getting this error when trying to register:
    W/System.err: org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
    W/System.err: at org.json.JSON.typeMismatch(JSON.java:112)
    W/System.err: at org.json.JSONObject.(JSONObject.java:169)
    at org.json.JSONObject.(JSONObject.java:182)
    at com.example.android_login.RegisterActivity.lambda$registerUser$2$RegisterActivity(RegisterActivity.java:92)
    at com.example.android_login.-$$Lambda$RegisterActivity$qdOjFYQokWmNALZZ9DYPuxf6hIc.onResponse(Unknown Source:6)
    at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:78)
    at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30)
    at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:106)
    at android.os.Handler.handleCallback(Handler.java:938)
    W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7523)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)

  • Very good explanation.
    I copied all files to my project, but I’m unable to assign MyApplication as the startscreen. It refuses in the manifest files.
    What am I doing wrong?
    All compiled with success.
    Manifest file : http://prntscr.com/tpb2sd

  • For those that no have time to translate.

    Config for Xamp server

    Step 1: go to the php.ini file at the path C: \ xampp \ php \ php.ini

    Step 2: find the line; extension = php_openssl.dll and remove the semicolon

    Step 3: find the SMTP, smtp_post, sendmail_from and sendmail_path lines and put the following if you will use gmail as smtp:

    SMTP = smtp.gmail.com
    smtp_port = 587
    sendmail_from = tu_direccion_de_correo_electronico@gmail.com
    sendmail_path = “\” C: \ xampp \ sendmail \ sendmail.exe \ “-t”
    If you copy and paste be careful with the quotes because the correct quote may not be inserted.

    Step 4: open the sendmail.ini file located at the path C: \ xampp \ sendmail \ sendmail.ini and configure it as follows:

    smtp_server = smtp.gmail.com
    smtp_port = 587
    error_logfile = error.log
    debug_logfile = debug.log
    auth_username=your_email@gmail.com
    auth_password = xxxxx
    force_sender=your_email@gmail.com

    Step 5: if you use gmail to send emails locally you must have the account that you must activate the option “Allow less secure applications to access your account” otherwise you will not be able to send emails with gmail, I leave the link https : //support.google.com/accounts/answer/6010255? hl = en-419

  • i am using window 32 bit with xamp,
    when i run the app from my mobile and try to register no any error pop up simly try to serch for some tme and quit

  • Pls which line are you talking about the mail() function
    I have another error when using forgot password
    it shows error below
    (value <br of type java.lang.string cannot be converted to jsonobject)
    Pls how will i do this

    This is the log

    ( ! ) Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp64\www\unilever_app\reset-password.php on line 54
    Call Stack
    #TimeMemoryFunctionLocation
    10.0010407224{main}( )…\reset-password.php:0
    20.1527460384mail
    ( )…\reset-password.php:54

    {“tag”:”forgot_pass”,”error”:false,”message”:”A new password has been sent to your e-mail address.”,”mail”:”Hello Muibi Azeez Abolade.\n\nWe received a request to change your password on Agbara Engineering App\n\nYour new password:\n\n HgFASy\n\nRegards,\nAgbara Engineering App.”}
    2020-03-19 08:20:40.173 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)
    2020-03-19 08:20:40.195 12050-12050/org.unilever.centralengineering W/System.err: org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.json.JSON.typeMismatch(JSON.java:111)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.json.JSONObject.(JSONObject.java:160)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.json.JSONObject.(JSONObject.java:173)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.unilever.centralengineering.LoginActivity$11.onResponse(LoginActivity.java:311)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.unilever.centralengineering.LoginActivity$11.onResponse(LoginActivity.java:303)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:78)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:106)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
    2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at android.os.Looper.loop(Looper.java:154)
    2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6125)
    2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at java.lang.reflect.Method.invoke(Native Method)
    2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
    2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
    2020-03-19 08:20:40.213 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)
    2020-03-19 08:20:40.307 12050-12082/org.unilever.centralengineering E/EGL_emulation: tid 12082: eglSurfaceAttrib(1259): error 0x3009 (EGL_BAD_MATCH)
    2020-03-19 08:20:40.307 12050-12082/org.unilever.centralengineering W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa9dac41cc0, error=EGL_BAD_MATCH
    2020-03-19 08:20:40.307 12050-12050/org.unilever.centralengineering W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
    2020-03-19 08:20:40.314 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)
    2020-03-19 08:20:40.711 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)

  • This has been depreciated on CONFIG.PHP
    if(function_exists(‘get_magic_quotes_gpc’) && get_magic_quotes_gpc()) {
    function undo_magic_quotes_gpc(&$array) {
    foreach($array as &$value) {
    if(is_array($value)) {
    undo_magic_quotes_gpc($value);
    }
    else {
    $value = stripslashes($value);
    }
    }
    }

    undo_magic_quotes_gpc($_POST);
    undo_magic_quotes_gpc($_GET);
    undo_magic_quotes_gpc($_COOKIE);
    }

      • Pls which line are you talking about the mail() function
        I have another error when using forgot password
        it shows error below
        (value <br of type java.lang.string cannot be converted to jsonobject)
        Pls how will i do this

        This is the log

        ( ! ) Warning: mail(): Failed to connect to mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in C:\wamp64\www\unilever_app\reset-password.php on line 54
        Call Stack
        #TimeMemoryFunctionLocation
        10.0010407224{main}( )…\reset-password.php:0
        20.1527460384mail
        ( )…\reset-password.php:54

        {“tag”:”forgot_pass”,”error”:false,”message”:”A new password has been sent to your e-mail address.”,”mail”:”Hello Muibi Azeez Abolade.\n\nWe received a request to change your password on Agbara Engineering App\n\nYour new password:\n\n HgFASy\n\nRegards,\nAgbara Engineering App.”}
        2020-03-19 08:20:40.173 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)
        2020-03-19 08:20:40.195 12050-12050/org.unilever.centralengineering W/System.err: org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.json.JSON.typeMismatch(JSON.java:111)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.json.JSONObject.(JSONObject.java:160)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.json.JSONObject.(JSONObject.java:173)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.unilever.centralengineering.LoginActivity$11.onResponse(LoginActivity.java:311)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at org.unilever.centralengineering.LoginActivity$11.onResponse(LoginActivity.java:303)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:78)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:106)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
        2020-03-19 08:20:40.196 12050-12050/org.unilever.centralengineering W/System.err: at android.os.Looper.loop(Looper.java:154)
        2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6125)
        2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at java.lang.reflect.Method.invoke(Native Method)
        2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
        2020-03-19 08:20:40.197 12050-12050/org.unilever.centralengineering W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
        2020-03-19 08:20:40.213 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)
        2020-03-19 08:20:40.307 12050-12082/org.unilever.centralengineering E/EGL_emulation: tid 12082: eglSurfaceAttrib(1259): error 0x3009 (EGL_BAD_MATCH)
        2020-03-19 08:20:40.307 12050-12082/org.unilever.centralengineering W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa9dac41cc0, error=EGL_BAD_MATCH
        2020-03-19 08:20:40.307 12050-12050/org.unilever.centralengineering W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
        2020-03-19 08:20:40.314 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)
        2020-03-19 08:20:40.711 12050-12082/org.unilever.centralengineering D/EGL_emulation: eglMakeCurrent: 0x7fa9f0637aa0: ver 3 1 (tinfo 0x7fa9f060c1a0)

  • Hello,
    Everything works fine except that I never receive the verification code by email.
    Can you help me
    Thank you

  • Hello,
    Everything works fine except the verification code that I do not get on my email address. I am on an external server.
    Thank you

  • Dear Mr. Akshay Raj,
    I need more information on “otp” and email verification. Could you please inform where or how can I find the above info?
    Thanks and best regards.

      • I connected LAN with ipv4 address 192.168.137.1
        so changed to
        String MAIN_URL = “http://192.168.137.1/android_login/”;

        I created folder android_login pasted those php files
        I copied android project
        I created database android_login, created table users as mentioned
        Used Xampp so all inside htdocs folder
        changed username and password in config.php

        Getting error:
        E/RegisterActivity: Registration Error: null
        com.android.volley.TimeoutError
        at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:169)
        at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:120)
        at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:87)

  • I got this error
    W/System.err: org.json.JSONException: Value Failed of type java.lang.String cannot be converted to JSONObject
    W/System.err: at org.json.JSON.typeMismatch(JSON.java:111)
    W/System.err: at org.json.JSONObject.(JSONObject.java:160)
    W/System.err: at org.json.JSONObject.(JSONObject.java:173)
    W/System.err: at com.dugange.hilarym.androidtodatabase.RegisterActivity$3.onResponse(RegisterActivity.java:108)
    W/System.err: at com.dugange.hilarym.androidtodatabase.RegisterActivity$3.onResponse(RegisterActivity.java:100)
    Your help please

  • I got this error

    W/System.err: org.json.JSONException: Value Failed of type java.lang.String cannot be converted to JSONObject
    W/System.err: at org.json.JSON.typeMismatch(JSON.java:111)
    W/System.err: at org.json.JSONObject.(JSONObject.java:160)
    W/System.err: at org.json.JSONObject.(JSONObject.java:173)
    W/System.err: at com.dugange.hilarym.androidtodatabase.RegisterActivity$3.onResponse(RegisterActivity.java:108)
    W/System.err: at com.dugange.hilarym.androidtodatabase.RegisterActivity$3.onResponse(RegisterActivity.java:100)

    Your help please

  • I have made a new project and added this files. app is closing without showing any matching errors in error log.
    But your project which i have downloaded is working

  • hello, In forgot password, mail is sent but not received. Below is the error log. Please help.
    [Thu May 24 10:25:34.653603 2018] [mpm_winnt:notice] [pid 10060:tid 680] AH00364: Child: All worker threads have exited.
    [Thu May 24 10:25:34.702636 2018] [mpm_winnt:notice] [pid 8924:tid 760] AH00430: Parent: Child process 10060 exited successfully.
    [Thu May 24 10:25:39.813855 2018] [ssl:warn] [pid 32:tid 740] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Thu May 24 10:25:39.890192 2018] [ssl:warn] [pid 32:tid 740] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Thu May 24 10:25:39.917211 2018] [mpm_winnt:notice] [pid 32:tid 740] AH00455: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5 configured — resuming normal operations
    [Thu May 24 10:25:39.917211 2018] [mpm_winnt:notice] [pid 32:tid 740] AH00456: Apache Lounge VC15 Server built: Mar 28 2018 12:12:41
    [Thu May 24 10:25:39.917211 2018] [core:notice] [pid 32:tid 740] AH00094: Command line: ‘C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache’
    [Thu May 24 10:25:39.946781 2018] [mpm_winnt:notice] [pid 32:tid 740] AH00418: Parent: Created child process 6424
    [Thu May 24 10:25:40.478289 2018] [ssl:warn] [pid 6424:tid 656] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Thu May 24 10:25:40.537104 2018] [ssl:warn] [pid 6424:tid 656] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Thu May 24 10:25:40.564123 2018] [mpm_winnt:notice] [pid 6424:tid 656] AH00354: Child: Starting 150 worker threads.
    sendmail: Error during delivery: Please log in via your web brows

      • hello Sir,
        I am getting error at b.putstring(“email”,email) in login activity,and also in getString method.
        It says, putstring cannot be resolved

  • I have followed all the steps on the tutorial. But when I either register or login on the app it invokes the registering dialog or the login dialog but it then shows an empty dialog nothing happens there after. Please help I am already using an online server

  • Sir i have executed the app but when i goto register activity then it goes to login activity and when i try to login then app crashes and closed. There is no data in mysql database. Please help me sir.

      • Thank you man!
        Am having an error trying to register;
        java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.waynem.kejaapp.MyApplication.addToRequestQueue(com.android.volley.Request, java.lang.String)’ on a null object reference
        Help me

        • 02-19 12:26:52.473 10195-10195/com.waynem.kejaapp E/AndroidRuntime: FATAL EXCEPTION: main
          Process: com.waynem.kejaapp, PID: 10195
          java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.waynem.kejaapp.MyApplication.addToRequestQueue(com.android.volley.Request, java.lang.String)’ on a null object reference
          at com.waynem.kejaapp.RegisterActivity.registerUser(RegisterActivity.java:163)
          at com.waynem.kejaapp.RegisterActivity.access$300(RegisterActivity.java:32)
          at com.waynem.kejaapp.RegisterActivity$1.onClick(RegisterActivity.java:75)
          at android.view.View.performClick(View.java:4848)
          at android.view.View$PerformClick.run(View.java:20262)
          at android.os.Handler.handleCallback(Handler.java:815)
          at android.os.Handler.dispatchMessage(Handler.java:104)
          at android.os.Looper.loop(Looper.java:194)
          at android.app.ActivityThread.main(ActivityThread.java:5637)
          at java.lang.reflect.Method.invoke(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:372)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

  • The first user is created perfectly, but when I try to register the second user it says “Database Error2. Please Try Again!”. I removed the first user from the mysql db and it again registered the 1st user and again an error on registering the 2nd user.

  • im using wampserver installed on my laptop and internet connected by wifi, for url i used ip address 192.168.1.2:8080 (refer to ipconfig). but when i try to RESEND CODE i got error message Json error:value