Tutorial 10
- Due No Due Date
- Points 5
- Submitting a file upload
- File Types apk
In Tutorial-08 you have created an Android Project to read the JSON file from the asset folder. Use the following code in tutorial-08 to fetch Json Data from the given URL and generate RecyclerView.
Sample Code:
requestQueue = Volley.newRequestQueue(getApplicationContext());
jsonArrayRequest = new JsonArrayRequest(
Request.Method.GET,
MyUtil.URL_USERS,
null,
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
MyUtil.userData = response;
userAdapter = new UserAdapter(response);
rcvUsers.setAdapter(userAdapter);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}
);
requestQueue.add(jsonArrayRequest);