0

Android Code

strUID = ((AQuery)aq.id(R.id.login_id)).getText().toString();
        strPW = ((AQuery)aq.id(R.id.login_password)).getText().toString();

        HashMap localHashMap = new HashMap();
        localHashMap.put("userid", strUID);
        localHashMap.put("password", strPW);        

        aq.ajax(strHostName, localHashMap, JSONObject.class, new AjaxCallback<JSONObject>()
        {
            public void callback(String paramString, JSONObject paramJSONObject, AjaxStatus paramAjaxStatus)
            {
                    if(paramJSONObject != null)
                    {
                        Log.d("LoginSignup", "LoginProcess call try : " + paramAjaxStatus.getCode() + " | " + paramJSONObject.toString());
                        return;
                    }
                    else
                    {
                        Log.d("LoginSignup", "ERROR : " + paramString + "|" + paramAjaxStatus.getCode() + "|" + paramAjaxStatus.getMessage());
                        return;                     
                    }


            }
        });

Server PHP Code

 $arrMine = $db->rawQuery($arrQuery);

    //echo json_encode($arrMine);

    // Only One
    for($i=0;$i<count($arrMine);$i++){
      $objResult->usn = $arrMine[$i]['usn'];
      $objResult->userid = $arrMine[$i]['userid'];
      $objResult->password = $arrMine[$i]['password'];
      break;
    }

    //print_r($objResult);

    echo json_encode($arrNotice);

  } catch(Exception $e){
    echo json_encode($e->getMessage());
  }

Error Code

ERROR : http://www.aropasoft.com/adpocket/member/login|-103|transform error

Why Error I don;t Know.....

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
노종협
  • 1
  • 1

2 Answers2

0

Try

 aq.ajax(strHostName, localHashMap, String.class, new AjaxCallback<String>()

then parse json from the string

124697
  • 22,097
  • 68
  • 188
  • 315
0

Aquery needs a JsonObject. Change this line

echo json_encode($arrNotice);

for this:

echo json_encode($arrNotice, JSON_FORCE_OBJECT);
joaoibarra
  • 101
  • 2