Send Parameter Together Json

-1

I need to make the jsonrequest() function also send the codigo parameter so that it searches only the same data in the MYSQL database.

Android function:

 private void jsonrequest() {

    request = new JsonArrayRequest(JSON_URL, new Response.Listener<JSONArray>() {
        @Override
        public void onResponse(JSONArray response) {

            JSONObject jsonObject  = null ;

            for (int i = 0 ; i < response.length(); i++ ) {

                try {
                    jsonObject = response.getJSONObject(i) ;
                    Leitor leitor = new Leitor() ;
                    leitor.setCodigoequipamento(jsonObject.getString("codigoequipamento"));
                    leitor.setDescricaoequipamento(jsonObject.getString("descricaoequipamento"));
                    leitor.setModelo(jsonObject.getString("modelo"));
                    leitor.setBtu(jsonObject.getString("btu"));
                    lstLeitor.add(leitor);

                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }

            setuprecyclerview(lstLeitor);
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {

        }
    });

    requestQueue = Volley.newRequestQueue(TelaLeitor2.this);
    requestQueue.add(request) ;
}
    
asked by anonymous 21.12.2018 / 18:23

0 answers