I have a mysql data base and a table in it, I encode it to json, when I run php file in browser i got something like this :
[
{
"product":"\u0645\u0627\u0633\u062a \u067e\u0631 \u0686\u0631\u0628 \u0633\u0648\u0646 \u06a9\u0627\u0644\u0647",
"info":"\u0645\u0627\u0633\u062a \u0633\u0648\u0646 \u06f5 \u062f\u0631\u0635\u062f \u0686\u0631\u0628\u06cc \u06f1\u060c\u06f5 \u06a9\u06cc\u0644\u0648\u06cc\u06cc \u06a9\u0627\u0644\u0647",
"price":"7\u060c800 \u062a\u0648\u0645\u0627\u0646",
"date":null,
"sale":"no sale",
"image":"Image source",
"buy":"Store"
}
]
that i think its ok , but when I get it in my android code its like the picture linked below:
this is the code i used in android
StringRequest stringRequest = new StringRequest(Request.Method.GET, server_url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONArray array = new JSONArray(response);
for (int i = 0; i < array.length(); i++) {
JSONObject product = array.getJSONObject(i);
productList.add(new Product(
product.getString("product"),
product.getString("info"),
product.getString("price"),
product.getString("date"),
product.getString("sale"),
product.getString("image"),
product.getString("buy")
));
}
ProductAdapter adapter = new ProductAdapter(MainActivity.this, productList);
recyclerView.setAdapter(adapter);
}
catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}
);
Volley.newRequestQueue(this).add(stringRequest);
So what can I do? Thank you for your time.