Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:23:40+00:00 2026-06-13T05:23:40+00:00

i got a problem… I am trying to store the udid of the device

  • 0

i got a problem…
I am trying to store the udid of the device into my database when a user register…
I got this error in the logcat:

10-18 17:17:08.141: E/JSON(1712): <br />
10-18 17:17:08.141: E/JSON(1712): <b>Warning</b>:  Missing argument 4 for DB_Functions::storeUser(), called in /home/matbest1/public_html/android_login_api/index.php on line 64 and defined in <b>/home/matbest1/public_html/android_login_api/include/DB_Functions.php</b> on line <b>25</b><br />
10-18 17:17:08.141: E/JSON(1712): {"tag":"register","success":0,"error":1,"error_msg":"Error occured in Registartion"}
10-18 17:17:08.151: E/JSON Parser(1712): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
10-18 17:17:08.381: D/dalvikvm(1712): GC_CONCURRENT freed 296K, 5% free 9394K/9799K, paused 2ms+4ms

I am trying to store the udid in database…
Heres the registeractivity:

public JSONObject registerUser(String name, String email, String password, String uid){
    // Building Parameters
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("tag", register_tag));
    params.add(new BasicNameValuePair("name", name));
    params.add(new BasicNameValuePair("email", email));
    params.add(new BasicNameValuePair("password", password));
    params.add(new BasicNameValuePair("uid", uid));

    // getting JSON Object
    JSONObject json = jsonParser.getJSONFromUrl(registerURL, params);
    // return json
    return json;
}

Register:

UserFunctions userFunction = new UserFunctions();
            JSONObject json = userFunction.registerUser(name, email, password, uid);

The php code:

 public function storeUser($name, $email, $password, $uid) {
    $uuid = $uid;
    $hash = $this->hashSSHA($password);
    $encrypted_password = $hash["encrypted"]; // encrypted password
    $salt = $hash["salt"]; // salt
    $result = mysql_query("INSERT INTO users(unique_id, name, email, encrypted_password, salt, created_at) VALUES('$uuid', '$name', '$email', '$encrypted_password', '$salt', NOW())");
    // check for successful store
    if ($result) {
        // get user details 
        $uid = mysql_insert_id(); // last inserted id
        $result = mysql_query("SELECT * FROM users WHERE uid = $uid");
        // return user details
        return mysql_fetch_array($result);
    } else {
        return false;
    }
}

&

  if ($tag == 'register') {
        // Request type is Register new user
        $name = $_POST['name'];
        $email = $_POST['email'];
        $password = $_POST['password'];
        $uid = $_POST['uid'];

        // check if user is already existed
        if ($db->isUserExisted($email)) {
            // user is already existed - error response
            $response["error"] = 2;
            $response["error_msg"] = "User already existed";
            echo json_encode($response);
        } else {
            // store user
            $user = $db->storeUser($name, $email, $password);
            if ($user) {
                // user stored successfully
                $response["success"] = 1;
                $response["uid"] = $user["unique_id"];
                $response["user"]["name"] = $user["name"];
                $response["user"]["email"] = $user["email"];
                $response["user"]["created_at"] = $user["created_at"];
                $response["user"]["updated_at"] = $user["updated_at"];
                echo json_encode($response);
            } else {
                // user failed to store
                $response["error"] = 1;
                $response["error_msg"] = "Error occured in Registartion";
                echo json_encode($response);
            }
        }
    } else {
        echo "Invalid Request";
    }
} else {
    echo "Access Denied";
}

Can someone help me? i am new to this… Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:23:41+00:00Added an answer on June 13, 2026 at 5:23 am

    The server response contains a PHP error displayed in HTML..

    So it’s normal that you android app can’t parse any JSON..

    First thing, you need to be sure that your android app sends all the needed informations (the 4 parameters PHP awaits) because the PHP error clealry tells you that it lacks the parameters #4 : $uid

    Try a
    print_r($_REQUEST);
    at the beginning of your php files to see if PHP receive all the parameters.. If not : the problem is in your android application (uid is a String ? an Integer ? DO you need to convert it ?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got problem about play wav file in my application. This is my error:
I've got problem with connecting to MySQL database on my freshly installed Windows 7
have a nice day. I got problem when trying to create an image from
got a problem, can't get my head around this jquery and would appreciate your
I have got problem with this method: public List<int> menu_wid_w_kat() { DataSet1TableAdapters.menu_widac_wszystkoTableAdapter pk =
I've got problem with use + stringWithContentsOfFile:usedEncoding:error: My problem in usedEncoding:(NSStringEncoding *)enc I don't
I've got problem with Activity Feed and event in JavaScript-SDK. When user log in
I found interesting problem with Win7/X64 machine. For this time I haven't got problem
I've got problem with this peace of code, it should change lower case letters
I got problem with this code: if (!empty($_GET[ lic ])) $lic = $_GET[ lic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.