this is my json response. I want to show values from 3rd index in a listview from every array...
"history":[["2","mega@gmail.com","21.2299924","72.8247365","1479718230719"],
["3","mega@gmail.com","21.2299926","72.8247346","1479718265453"],
["4","mega@gmail.com","21.2299924","72.8247345","1479719800472"],
["5","mega@gmail.com","21.2299927","72.8247354","1479720302919"],
["6","mega@gmail.com","21.2299926","72.8247344","1479720880373"],
["7","mega@gmail.com","21.2299926","72.8247343","1479721139992"]]}
this is my php code:
$email = $_POST['email'];
      $con = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD) or                die(mysqli_error($con));
        mysqli_select_db($con,DB_DATABASE) or die(mysqli_error($con));
       $result = mysqli_query($con,"SELECT * from tbl_userhistory WHERE   email = '$email'");
        $no_of_rows = mysqli_num_rows($result);
         if ($no_of_rows > 0) {
        $rows = array();
        while ($row = mysqli_fetch_row($result)) {
        $rows[] = $row;
        }
            $response["history"] =$rows;
            echo json_encode($response);
}
     else {
        return false;
    }
this is the code where i want to get values.. : I am getting response but not in proper format. i just want latitiude, longitude lastupddate from each row.
 private  void getHistory(final String em){
    String tag_string_location= "group_history";
    pDialog.setMessage("Getting Group members history...");
    showDialog();
    StringRequest strReqLocation = new StringRequest(Request.Method.POST,
            Config_URL.URL_REGISTER, new Response.Listener<String>(){
        @Override
        public void onResponse(String response) {
            Log.d("Activity_main", "getting group history " + response.toString());
            hideDialog();
            try {
                JSONObject jObj = new JSONObject(response);
                boolean error = jObj.getBoolean("error");
                if (!error) {
                    // String groupid = jObj.getString("groupid");
                    JSONArray obj =jObj.getJSONArray("history");
                    if (obj != null) {
                        for (int i=0;i<obj.length();i++){
                            listdata.add(obj.get(i).toString());
                        }
                    }
                    GroupAdapter gAdapter=new    GroupAdapter(HistoryUser.this,listdata);
                    lvHistory.setAdapter(gAdapter);
                    Log.d("main", "New group  " + obj);
                }
                else {
                    // Error occurred in registration. Get the error
                    // message
                    String errorMsg = jObj.getString("error_msg");
                    Toast.makeText(getApplicationContext(),
                            errorMsg, Toast.LENGTH_LONG).show();
                }
            }catch (JSONException e) {
                e.printStackTrace();
            }
        }
    },new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            Log.e("MainAct", "group Error: " + error.getMessage());
            Toast.makeText(getApplicationContext(),
                    error.getMessage(), Toast.LENGTH_LONG).show();
            hideDialog();
        }
    }){
        @Override
        protected Map<String, String> getParams() {
            // Posting params to register url
            Map<String, String> params = new HashMap<String, String>();
            params.put("tag", "gethistory");
            //  params.put("name", name);
            params.put("email", em);
            // params.put("password", password);
            return params;
        }
    };
    // Adding request to request queue
    AppController.getInstance().addToRequestQueue(strReqLocation, tag_string_location);
}
 
     
     
    