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) ;
}