ࡱ > U W T # bjbjOO 4P -a -a @ @ @ @ @ T T T T l L T }/ . . . . . . . . $ 1 ]4 "/ @ "/ @ @ 7/ @ @ . . + | - @& @, . M/ 0 }/ R, 5 5 $ - 5 @ - > 9 , e $ "/ "/ . }/ 5 : Chapter 7 Maps and Location in Android 7.1 True/False Questions 1. To use both the network and GPS location services, you must instantiate two LocationManagers. Answer: False 2. A LocationListener must be instantiated for the location sensor you want to get location data from. Answer: True 3. A location change identified by the location sensor is broadcast as an Intent with Extras. Answer: False 4. Location changes detected by the location sensors is reported as a Location object. Answer: True 5. The map used in Android is a widget available to any Activity. Answer: False 6. You need an Application Program Interface key to display maps on an Android device. Answer: True 7. You cannot use a standard Activity if you want to display a Map in an Android device. Answer: True 8. A Location object reports latitude and longitude but not accuracy. Accuracy is reported by the listener directly. Answer: False 9. To use maps, you must implement code provided by Google that has nothing to do with map functionality. Answer: True 10. Geocoding is the process of changing an address into GPS coordinates. Answer: True 11. Your app must always check to see that the new reported location is better than the last reported location. Answer: False 12. Markers on a map can contain a title but no other data. Answer: False 13. A map type (satellite, street) is set at map creation and cannot be changed. Answer: False 14. A change in accuracy is reported as a new Location. Answer: True 15. An app needs several permissions to use a Google map. Answer: True 16. You cannot get a devices GPS location from a Google map. Answer: False 17. You cannot add multiple markers to a Google map. Answer: False 18. The standard marker on a GoogleMap object can be replaced with a custom image. Answer: True 7.2 Multiple Choice Questions 1. Which of the following best describes a LocationManager? A. An object that reports location changes to an app B. A system service that can start and stop the network sensor but not the GPS sensor C. A system service that can request location updates from the network and GPS sensors D. An object that is subclassed in a MapFragment Activity Answer: C 2. Which of the following best describes the onLocationChanged method? A. A required method of a LocationListener that responds to any reported Location object B. A required method of a LocationListener that responds only to Location objects that are newer C. A method of the LocationManager that formats a Location object for use in an app D. A method of the Location object that responds to the detection of a new location Answer: A 3. Which of the following best describes a MapFragment? A. A subclass of Activity B. A GoogleMap object embedded in a layout file C. A subclass of FragmentActivity D. A dialog used to display a map Answer: B 4. Where is your Android Map's API key embedded in the app? A. The MapFragment B. The GoogleMap object C. The onCameraActivate method D. The manifest file Answer: D 5. Where do you get an Android Maps API key? A. The Developer Console B. The API Console C. The Debug Keystore D. The Google Keystore Answer: B 6. Which of the following is the correct variable declaration to hold the results of a call to the Geocoding service? A. Coordinates returnedCoords B. Address[] returnedAddresses C. List
returnedAddresses D. Array[Address] returnedAddresses Answer: C 7. Why should the call to the Geocoder service be protected with a try and catch statement? A. Because the results of the call to the service are outside the control of the developer. B. Because Geocoding is inherently error prone. There might not be a GPS location. C. Because Geocoding is not in the Android SDK. D. It should not be used with a try and catch. Answer: A 8. Which of the following is the best description of a Location object? A. An object that detects a change in location reported by the network or GPS sensor. B. An object that is created when a location change is detected by the network or GPS sensor. C. An object that responds to onLocationChanged. D. Any object that contains location or Geocoding data. Answer: B 9. What is a Toast? A. An object created when the GPS or network sensors fail to detect any location B. An object created when the sensors produce a location detection outside the bounds of the requestUpdates parameters C. An object that reports errors through onLocationChanged D. An object that displays a short message on the user screen for limited amount of time Answer: D 10. Which of the following objects can turn off the GPS sensor? A. LocationManager B. LocationListener C. LocationSensor D. GPSManager Answer: A 11. Which sensor produces the most accurate location determinations? A. Network sensor B. Wi-Fi sensor C. Position sensor D. GPS sensor Answer: D 12. After your app sets MyLocationEnabled to true, what do you need to do to detect the devices location? A. Nothing. Enabling this displays and reports GPS coordinates to the map. B. Add a OnMyLocationChangeListener to the FragmentActivity. C. Add the onMyLocationChanged method to the FragmentActivity. D. Set a new LatLng point to track the devices location. Answer: B 13. Which of the following is NOT a type of map that can be set for a GoogleMap object? A. NORMAL B. SATELLITE C. TERRAIN D. STREET Answer: D 14. Which of the following is the method that is used to zoom the map to a specific location? A. animateCamera B. zoomTo C. displayMap D. zoomLevel Answer: A 15. Which of the following is the correct method to add a marker to a GoogleMap object? A. displayMarker B. animateMarker C. addMarker D. addPinWithImage Answer: C 16. Which of the following objects is used to collect a set of locations for display on a GoogleMap object? A. LatLngSet B. LatLngBounds.Builder C. LatLngPointSet D. GpsPointSet.BoundingBox Answer: B 7.3 Matching Questions 1. Match the following terms with the best definition or explanation. requestLocationUpdates LocationManager GoogleMap object FragmentActivity Location Geocoding onMyLocationChange isBetterLocation LocationListener Snippet A. An object that holds the data reported from a LocationListener. B. The method used to start listening for location changes from a location sensor. C. Text that is displayed when the user touches a marker on a map. D. An object in an SDK separate from the Android SDK. E. An object that determines what an app will do when its location changes. F. The method used to get location updates from a map. G. A system service object that can request location updates from either location sensor. H. A procedure to turn a street address into GPS coordinates. I. A method not provided by the map, or any other object in the Android SDK. J. An activity used to display multiple Activities on a single layout. Answer: B, G, D, J, A, H, F, I, E, C ' ( ) , - B C D E F b f w x 1 zslel^e^e^lVlel^OGO hO hw\ 5hO hw\ hO h] 5hO hd hO h(&G