Lab7 Self Assessment
Lab7 Self Assessment
Q1 What is the purpose of Volley in Android?
Answer
Answer: A convenience library that makes network calls easier and faster.
Q2To use Volley in Android, the following line must be added to what file in the Android Project?
implementation 'com.android.volley:volley:1.2.1'
Answer
Answer: build.gradle app
Q3 If the UI begins to behave sluggishly or crash while making network calls this is likely due to
Answer
Answer: Network Latency
Q4 What must be set in the Android project in order to use Volley? (There is more than 1 answer)
Answer
Answer: All Correct EXCEPT The ProgressBar in the activity_main.xml
Q5 What is the Request class included in the Android Volley ? (There is more than 1 answer)
Answer
Answer: All Correct EXCEPT Boolean request
Q6 How many parameters are there in the JsonObjectRequest of Android Volley?
Answer
Answer: 5
Q7 What caused the following RunTime Exception [Permission Denied] as shown in the screenshot from Android Studio below?

Answer
Answer: Programmer did not set Permission for accessing Network in AndroidManifest file
Q8 Which one of the following code snippets is the correct sequence to use Volley in Android app?
Answer
Answer:
RequestQueue requestQueue = Volley.newRequestQueue(this);
JsonObjectRequest request = JsonObjectRequest(Request.Method.GET, url, jsonRequest, new ResponseListener(), new ErrorListener());
requestQueue.add(request);
Q9 Below is the sample code to create a JsonObjectRequest. What is the purpose of the ResponseListener( )?
JsonObjectRequest request = JsonObjectRequest(Request.Method.POST, url, jsonRequest, new ResponseListener(), new ErrorListener());
Answer
Answer: For you to add codes to handle the response from the web
Q10 Below is the sample code to create a JsonObjectRequest. What is the purpose of the the parameter 'jsonRequest' inside the JsonObjectRequest shown below?
JsonObjectRequest request = JsonObjectRequest(Request.Method.POST, url, jsonRequest, new ResponseListener(), new ErrorListener());
Answer
Answer: The JSON object that you want to post with the request
Comments
Post a Comment