MCQs / Computer Science / Maps and Consuming Web Services over HTTP
Maps and Consuming Web Services over HTTP MCQs — Computer Science 39 multiple-choice questions on Maps and Consuming Web Services over HTTP from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.
1. geo:0,0?q=33.6844,73.0479(Faisal Mosque) will: Send an SMS Show a marker labelled Faisal Mosque at the coordinates Call a phone number Open the camera Answer: B) Show a marker labelled Faisal Mosque at the coordinates
Explanation: The q parameter with a label in brackets drops a labelled marker.
Discuss this question
2. Retrofit is developed by: JetBrains Google Square Meta Answer: C) Square
Explanation: Retrofit and OkHttp are Square's libraries.
Discuss this question
3. Latitude values range from: −90 to +90 0 to 100 −180 to +180 0 to 360 Answer: A) −90 to +90
Explanation: Latitude measures north–south from −90 to +90 degrees.
Discuss this question
4. Which converter turns JSON into Kotlin objects in Retrofit? SQLite ContentResolver GsonConverterFactory (or Moshi/kotlinx converter) LayoutInflater Answer: C) GsonConverterFactory (or Moshi/kotlinx converter)
Explanation: Converter factories (de)serialise JSON.
Discuss this question
5. The Android class that converts an address to coordinates (and back) is: Projection Geocoder MapView LocationManager Answer: B) Geocoder
Explanation: Geocoder performs forward and reverse geocoding.
Discuss this question
6. Which permission does an app need to access the internet? ACCESSFINELOCATION READEXTERNALSTORAGE BINDINTERNET INTERNET Answer: D) INTERNET
Explanation: android.permission.INTERNET is a normal permission.
Discuss this question
7. Which callback provides the GoogleMap object when it is ready? onResume() onMapLoaded only onCreate() onMapReady(googleMap) Answer: D) onMapReady(googleMap)
Explanation: getMapAsync(this) eventually calls onMapReady.
Discuss this question
8. Performing a network request on the main thread causes: SecurityException Faster loading NetworkOnMainThreadException A notification Answer: C) NetworkOnMainThreadException
Explanation: Android forbids network calls on the UI thread.
Discuss this question
9. A web service is: A layout file Software on a server that apps call over the network (usually HTTP) to get or send data A type of Android service that plays music A database on the phone Answer: B) Software on a server that apps call over the network (usually HTTP) to get or send data
Explanation: Mobile apps act as clients of web services.
Discuss this question
10. Which code moves the camera to a location at zoom 15? map.goTo(15) map.camera = latLng map.zoom(15) map.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15f)) Answer: D) map.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15f))
Explanation: CameraUpdateFactory creates camera updates.
Discuss this question
11. Which built-in Java class can make HTTP requests without libraries? SharedPreferences HttpURLConnection SQLiteOpenHelper TextWatcher Answer: B) HttpURLConnection
Explanation: HttpURLConnection is part of java.net.
Discuss this question
12. Which Retrofit annotation adds ?userId=1 to the URL? @Field @Query @Path @Body Answer: B) @Query
Explanation: @Query adds query parameters.
Discuss this question
13. Which URI starts turn-by-turn navigation in Google Maps? tel:33.68,73.04 google.navigation:q=33.68,73.04 maps://drive geo:nav:33.68,73.04 Answer: B) google.navigation:q=33.68,73.04
Explanation: google.navigation: opens navigation mode.
Discuss this question
14. Since Android 9, plain HTTP (non-HTTPS) traffic is: Faster than HTTPS Blocked by default (cleartext traffic not permitted) Required by Play Always allowed Answer: B) Blocked by default (cleartext traffic not permitted)
Explanation: Apps must use HTTPS or explicitly allow cleartext.
Discuss this question
15. Which map type shows satellite images with road labels? MAPTYPETERRAIN MAPTYPENORMAL MAPTYPEHYBRID MAPTYPENONE Answer: C) MAPTYPEHYBRID
Explanation: Hybrid combines satellite imagery with labels.
Discuss this question
16. In a geo: URI, the parameter z=15 sets the: Zoom level (1 = world, about 20 = buildings) Time zone Latitude Altitude in metres Answer: A) Zoom level (1 = world, about 20 = buildings)
Explanation: z controls the initial zoom.
Discuss this question
17. While data is downloading, a good app shows: Nothing A progress indicator, and an error/Retry message if it fails A blank white screen The splash screen forever Answer: B) A progress indicator, and an error/Retry message if it fails
Explanation: Loading, error and empty states improve user experience.
Discuss this question
18. Status code 401 means: Not found Created OK Unauthorized (missing or invalid credentials) Answer: D) Unauthorized (missing or invalid credentials)
Explanation: 401 requires authentication.
Discuss this question
19. The Maps SDK API key is placed in the manifest inside a: uses-permission element meta-data element named com.google.android.geo.APIKEY activity element string resource only Answer: B) meta-data element named com.google.android.geo.APIKEY
Explanation: The key is read from the com.google.android.geo.APIKEY meta-data.
Discuss this question
20. Which Retrofit annotation replaces id in users/id? @Path("id") @Query("id") @Body @Header("id") Answer: A) @Path("id")
Explanation: @Path substitutes URL path segments.
Discuss this question
21. To embed a Google Map inside an activity you use: ListView WebView only ImageView SupportMapFragment (or MapView) Answer: D) SupportMapFragment (or MapView)
Explanation: SupportMapFragment hosts an interactive GoogleMap.
Discuss this question
22. In Kotlin, withContext(Dispatchers.IO) ... is used to: Restart the activity Create a notification Update the UI Run blocking network/disk code on a background thread Answer: D) Run blocking network/disk code on a background thread
Explanation: Dispatchers.IO is optimised for I/O work off the main thread.
Discuss this question
23. Which approach shows a location WITHOUT an API key? An implicit intent with a geo: URI that opens the Google Maps app Places API Google Maps SDK with SupportMapFragment Directions API Answer: A) An implicit intent with a geo: URI that opens the Google Maps app
Explanation: Map intents hand the work to the Maps app and need no key.
Discuss this question
24. Which org.json class represents "name": "Ali" ? JSONArray JSONString JSONObject JsonReader only Answer: C) JSONObject
Explanation: A JSON object maps keys to values.
Discuss this question
25. In JSON, square brackets [ ] denote: An array A string An object A comment Answer: A) An array
Explanation: Arrays use [ ]; objects use .
Discuss this question
Page 1 of 2 Next
Practise Maps and Consuming Web Services over HTTP MCQs
More Computer Science chapters