1. Are you ready for the Galaxy S20? Here is everything we know so far!

Need Help with Login App Using XML/HttpURL/PHP/SQL

Discussion in 'Android Development' started by ac4android, Jul 10, 2017.

  1. ac4android

    ac4android Well-Known Member
    Thread Starter

    I am trying to create a login app using email and a password using HttpURL.
    I am getting an email/password error back from the PHP I've created on the remote server.

    Here is the XML that gets the email/password variables, the work well:
    Code (Text):
    1.  
    2.            <EditText
    3.                 android:id="@+id/et_email"
    4.                 android:layout_width="match_parent"
    5.                 android:layout_height="wrap_content"
    6.                 android:hint="@string/prompt_email"
    7.                 android:inputType="textEmailAddress"
    8.                 android:maxLines="1"
    9.                 android:singleLine="true" />
    10.  
    11.             <EditText
    12.                 android:id="@+id/et_password"
    13.                 android:layout_width="match_parent"
    14.                 android:layout_height="wrap_content"
    15.                 android:layout_below="@+id/email"
    16.                 android:layout_marginTop= "25dp"
    17.                 android:hint="@string/prompt_password"
    18.                 android:inputType="textPassword"
    19.                 android:maxLines="1"
    20.                 android:singleLine="true" />
    21.  
    Here is the part of the Android Java that grabs the email/login and send the pair to PHP, the logindata seems to have some spurious characeters in it, there also seems to be an extra space before the "com"...
    View attachment 121550

     


    #1 ac4android, Jul 10, 2017
    Last edited: Jul 10, 2017
  2. Best Answer:
    Post #4 by Deleted User, Jul 10, 2017 (1 points)

    1. Download the Forums for Android™ app!


      Download

       
  3. Deleted User

    Deleted User Guest

    Can't answer this question without seeing the code which initialises variable 'logindata'.
     
  4. ac4android

    ac4android Well-Known Member
    Thread Starter

    The loginData is in the attachment, it is a .jpg because I wanted to include the debug output.
    Please click on the attachment
    That's where I think the error crept in but I do not know for sure and I will keep testing tomorrow.
     
    #3 ac4android, Jul 10, 2017
    Last edited: Jul 10, 2017
  5. Deleted User

    Deleted User Guest

    Ok, but as I say, we need to see the Java code which assigns the value to this variable, in order to explain how the variable got this erroneous value in the first place. Simply looking at its value isn't enough for someone to diagnose the problem.
     
    ac4android likes this.
  6. ac4android

    ac4android Well-Known Member
    Thread Starter

    I added a few lines of codes to allow URI chars, that didn't work either. I am sending a .jpg with the debug data.
     

    Attached Files:

    #5 ac4android, Jul 10, 2017
    Last edited: Jul 10, 2017
  7. ac4android

    ac4android Well-Known Member
    Thread Starter

    Thanks for the good tip.

    We can close this thread now, it was... a lot of little things and not just one thing.
     
    sweetndreemy73 and Deleted User like this.
Loading...

Share This Page

Loading...