0% found this document useful (0 votes)
32 views

Based Android Question With Answer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Based Android Question With Answer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Chapter 03: Basics of Android GUI

1.

Which method is used to create a user interface declaratively in Android?

2.
1. A. XML
2. B. Java
3. C. C++
4. D. Python
5. Correct Answer: A
3.

What is the main advantage of using a programmatic user interface?

4.

1. A. Readability
2. B. Ease of use
3. C. Handling user input
4. D. Complexity
5. Correct Answer: C

5.

Which view group aligns all children in a single direction, vertically or


horizontally?

6.

1. A. RelativeLayout
2. B. TableLayout
3. C. LinearLayout
4. D. GridView
5. Correct Answer: C

7.

What is the primary use of a FrameLayout?

8.

1. A. Displaying multiple views


2. B. Displaying a single view
3. C. Grouping views into rows and columns
4. D. Displaying views in a relative position
5. Correct Answer: B
9.

Which layout allows specifying the exact location of its children?

10.

1. A. AbsoluteLayout
2. B. FrameLayout
3. C. LinearLayout
4. D. RelativeLayout
5. Correct Answer: A

11.

Which adapter is commonly used when the data source is an array?

12.

1. A. SimpleCursorAdapter
2. B. ArrayAdapter
3. C. BaseAdapter
4. D. RecyclerView.Adapter
5. Correct Answer: B

13.

What is the attribute to define the height of dividers between list items in
a ListView?

14.

1. A. android
2. B. android
3. C. android
4. D. android
5. Correct Answer: B

15.

Which GridView attribute specifies the number of columns to display?

16.

1. A. android
2. B. android
3. C. android
4. D. android
5. Correct Answer: B
17.

What UI control is used to display text to the user?

18.

1. A. EditText
2. B. TextView
3. C. Button
4. D. ImageButton
5. Correct Answer: B

19.

Which UI control is similar to EditText but shows completion


suggestions?

20.

1. A. AutoCompleteTextView
2. B. Spinner
3. C. ListView
4. D. RadioButton
5. Correct Answer: A

Chapter 03(part2): Menus, Dialogues, and Lists

1.

What is the primary collection of menu items for an activity called?

2.

1. A. Options menu
2. B. Context menu
3. C. Popup menu
4. D. Submenu
5. Correct Answer: A

3.

Which menu appears when a user performs a long-click on an element?

4.

1. A. Options menu
2. B. Context menu
3. C. Popup menu
4. D. Submenu
5. Correct Answer: B

5.

Where should menu items that have a global impact on the app be
placed?

6.

1. A. Context menu
2. B. Options menu
3. C. Popup menu
4. D. Submenu
5. Correct Answer: B

7.

In which directory do you place a file to define a menu in XML?

8.

1. A. res/layout/
2. B. res/menu/
3. C. res/values/
4. D. res/xml/
5. Correct Answer: B

9.

What attribute in a menu item specifies when and how the item should
appear as an action item?

10.

1. A. android
2. B. android
3. C. android
4. D. android
5. Correct Answer: D

11.

Which element is used to create a submenu in an XML menu definition?

12.

1. A. <group>
2. B. <item>
3. C. <menu>
4. D. <action>
5. Correct Answer: C

13.

How do you inflate a menu resource in an activity?

14.

1. A. Using LayoutInflater.inflate()
2. B. Using MenuInflater.inflate()
3. C. Using Activity.inflate()
4. D. Using Context.inflate()
5. Correct Answer: B

15.

Which type of menu is displayed as a list of items anchored to the view


that invoked the menu?

16.

1. A. Options menu
2. B. Context menu
3. C. Popup menu
4. D. Submenu
5. Correct Answer: C

17.

What is an optional invisible container for <item> elements in a menu


XML?

18.

1. A. <group>
2. B. <menu>
3. C. <item>
4. D. <action>
5. Correct Answer: A

19.

Which menu element creates a MenuItem that can contain a nested


menu?
20.

1. A. <group>
2. B. <menu>
3. C. <item>
4. D. <action>
5. Correct Answer: C

Chapter 03(part3): Notifications and Toasts

1.

What is a notification in Android?

2.

1. A. A message displayed within the app's UI


2. B. A message displayed outside of the app's normal UI
3. C. A dialog box that requires user interaction
4. D. An alert that appears only in the app's settings
5. Correct Answer: B

3.

Where does a notification first appear when issued?

4.

1. A. Notification drawer
2. B. Notification bar
3. C. Notification area
4. D. Home screen
5. Correct Answer: C

5.

Which class is used to create a notification in Android?

6.

1. A. NotificationManager
2. B. NotificationBuilder
3. C. Notification
4. D. NotificationService
5. Correct Answer: C

7.
What method is used to set a small icon for a notification?

8.

1. A. setSmallIcon()
2. B. setIcon()
3. C. setImage()
4. D. setNotificationIcon()
5. Correct Answer: A

9.

Which style displays a large view when a notification is expanded?

10.

1. A. Normal view
2. B. Compact view
3. C. Big view
4. D. Detailed view
5. Correct Answer: C

11.

What class provides a builder interface to create a Notification object?

12.

1. A. NotificationManager
2. B. NotificationBuilder
3. C. Notification.Builder
4. D. NotificationService
5. Correct Answer: C

13.

Which element in a normal view notification refers to the time it was


issued?

14.

1. A. Content title
2. B. Large icon
3. C. Content text
4. D. Time
5. Correct Answer: D

15.
Which big view style displays a bitmap up to 256 dp tall?

16.

1. A. Big picture style


2. B. Big text style
3. C. Inbox style
4. D. Summary style
5. Correct Answer: A

17.

What is a Toast in Android?

18.

1. A. A type of notification
2. B. A brief message displayed on the screen
3. C. An alert dialog
4. D. A type of menu
5. Correct Answer: B

19.

How is a Toast positioned on the screen by default?

20.

1. A. At the bottom
2. B. In the center
3. C. At the top
4. D. On the left side
5. Correct Answer: A

21.

Which method is used to show a Toast message?

22.

1. A. Toast.show()
2. B. Toast.display()
3. C. Toast.makeText()
4. D. Toast.toast()
5. Correct Answer: A

23.
What is the default duration for a Toast message?

24.

1. A. SHORT
2. B. LONG
3. C. MEDIUM
4. D. INFINITE
5. Correct Answer: A

25.

Which method is used to create a Toast message?

26.

1. A. Toast.show()
2. B. Toast.display()
3. C. Toast.makeText()
4. D. Toast.create()
5. Correct Answer: C

27.

Which parameter is NOT required for creating a Toast message using


makeText()?

28.

1. A. Context
2. B. Message
3. C. Duration
4. D. Position
5. Correct Answer: D

29.

Which attribute in the Notification class specifies the content text?

30.

1. A. setSmallIcon()
2. B. setContentTitle()
3. C. setContentText()
4. D. setContentInfo()
5. Correct Answer: C

31.
What is the primary purpose of the NotificationManager class?

32.

1. A. To create notifications
2. B. To manage and issue notifications
3. C. To display notifications
4. D. To remove notifications
5. Correct Answer: B

33.

How do you update a notification in Android?

34.

1. A. Issue a new notification


2. B. Use NotificationManager.notify() with the same ID
3. C. Remove the old notification and issue a new one
4. D. Use Notification.update()
5. Correct Answer: B

35.

What method is used to cancel a specific notification?

36.

1. A. NotificationManager.cancel()
2. B. Notification.cancel()
3. C. Notification.remove()
4. D. NotificationManager.remove()
5. Correct Answer: A

37.

What component is essential for displaying custom views in notifications?

38.

1. A. RemoteViews
2. B. CustomViews
3. C. ViewGroup
4. D. ViewBuilder
5. Correct Answer: A

39.
Which class is used to define a custom view for a Toast?

40.

1. A. Toast.CustomView
2. B. Toast.CustomToast
3. C. Toast
4. D. Toast.setView()
5. Correct Answer: D

Chapter 04: Intent

1.

What is an Intent in Android?

2.

1. A. A component for building UI


2. B. A messaging object used to request an action from another app component
3. C. A data structure used to manage UI elements
4. D. A database component
5. Correct Answer: B

3.

Which method is used to start a new activity?

4.

1. A. startActivity()
2. B. startService()
3. C. sendBroadcast()
4. D. startNewActivity()
5. Correct Answer: A

5.

What type of intent is used to start an activity within the same app?

6.

1. A. Explicit Intent
2. B. Implicit Intent
3. C. Internal Intent
4. D. Local Intent
5. Correct Answer: A
7.

Which method is used to bind an activity to a service?

8.

1. A. bindActivity()
2. B. bindService()
3. C. startService()
4. D. startBind()
5. Correct Answer: B

9.

What type of intent specifies an action to be performed and allows the


system to find an activity or service that can perform the action?

10.

1. A. Explicit Intent
2. B. Implicit Intent
3. C. Action Intent
4. D. Service Intent
5. Correct Answer: B

11.

Which method is used to send a broadcast?

12.

1. A. sendActivity()
2. B. sendService()
3. C. sendBroadcast()
4. D. sendIntent()
5. Correct Answer: C

13.

Which of the following is NOT a component of an Intent?

14.

1. A. Action
2. B. Data
3. C. Type
4. D. Layout
5. Correct Answer: D
15.

How do you pass data to a new activity using an Intent?

16.

1. A. Using putExtra() method


2. B. Using putData() method
3. C. Using addData() method
4. D. Using sendData() method
5. Correct Answer: A

17.

Which method is used to set the action for an Intent?

18.

1. A. setAction()
2. B. setIntentAction()
3. C. setActivityAction()
4. D. setServiceAction()
5. Correct Answer: A

19.

What is the purpose of the FLAG_ACTIVITY_NEW_TASK flag?

20.

1. A. To create a new task and launch an activity as the root of the new task
2. B. To launch a new activity in the same task
3. C. To clear the existing task and start a new activity
4. D. To reuse an existing task for the new activity
5. Correct Answer: A

21.

Which class is used to create and send a broadcast?

22.

1. A. BroadcastManager
2. B. LocalBroadcastManager
3. C. IntentManager
4. D. NotificationManager
5. Correct Answer: B
23.

Which method is used to add a category to an Intent?

24.

1. A. addCategory()
2. B. setCategory()
3. C. putCategory()
4. D. attachCategory()
5. Correct Answer: A

25.

What does the startActivityForResult() method do?

26.

1. A. Starts an activity and expects a result back


2. B. Starts an activity without expecting a result
3. C. Starts a service and expects a result back
4. D. Starts a broadcast and expects a result
5. Correct Answer: A

27.

What is the request code used for in startActivityForResult()?

28.

1. A. To identify the request when the result is returned


2. B. To specify the action to be performed
3. C. To define the intent's data type
4. D. To set the category of the intent
5. Correct Answer: A

29.

Which method is used to retrieve the result from a started activity?

30.

1. A. onActivityResult()
2. B. getActivityResult()
3. C. retrieveActivityResult()
4. D. fetchActivityResult()
5. Correct Answer: A
31.

How can you start a service using an Intent?

32.

1. A. startActivity()
2. B. startService()
3. C. sendService()
4. D. startIntentService()
5. Correct Answer: B

33.

Which flag ensures that the target activity is not in the activity stack?

34.

1. A. FLAG_ACTIVITY_CLEAR_TOP
2. B. FLAG_ACTIVITY_NO_HISTORY
3. C. FLAG_ACTIVITY_CLEAR_TASK
4. D. FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
5. Correct Answer: B

35.

What is the main difference between explicit and implicit intents?

36.

1. A. Explicit intents specify a particular component to start, while implicit intents do


not
2. B. Explicit intents are used for services, and implicit intents are used for activities
3. C. Explicit intents are used for broadcasts, and implicit intents are used for activities
4. D. Explicit intents are used within the app, and implicit intents are used between
apps
5. Correct Answer: A

37.

Which method is used to check if an intent resolves to an activity?

38.

1. A. resolveActivity()
2. B. checkActivity()
3. C. findActivity()
4. D. lookupActivity()
5. Correct Answer: A

39.

How do you define an intent filter for an activity in the Android manifest?

40.

1. A. Using <intent-filter> tag within <activity> tag


2. B. Using <intent> tag within <activity> tag
3. C. Using <filter> tag within <activity> tag
4. D. Using <activity-filter> tag
5. Correct Answer: A

Chapter 4
· What is the primary purpose of persistence in data storage for Android apps?

 · A) To increase app performance


 B) To store volatile objects permanently
 C) To enhance app security
 D) To improve user interface design
 Correct Answer: B

· Where can permanent files be stored on an Android device?

 · A) Only in the device’s main memory


 B) Only in the SD card
 C) In both the device’s main memory and SD card
 D) Only in the cloud
 Correct Answer: C

· What are internal files in Android also known as?

 · A) Shared Files
 B) Resource Files
 C) Public Files
 D) System Files
 Correct Answer: B

· Which parameter is NOT a determinant for choosing a persistent


environment?

 · A) Size
 B) Color
 C) Location
 D) Accessibility
 Correct Answer: B

· Which storage option is used for storing private primitive data in key-value
pairs?

 · A) Internal Storage
 B) External Storage
 C) Shared Preferences
 D) SQLite Databases
 Correct Answer: C

· What type of data is typically stored in SharedPreferences?

 · A) Complex objects
 B) Primitive data types
 C) Multimedia files
 D) SQL tables
 Correct Answer: B

· Which of the following is NOT a typical use of SharedPreferences?

 · A) Storing user settings


 B) Storing application state information
 C) Storing large multimedia files
 D) Sharing data among several activities
 Correct Answer: C

· In the provided example, what is the name of the SharedPreferences file used?

 · A) MyPrefs
 B) UserPrefs
 C) DataPrefs
 D) ConfigPrefs
 Correct Answer: A

· Which method is used to save data into SharedPreferences?

 · A) putData()
 B) saveData()
 C) commit()
 D) apply()
 Correct Answer: C

· What must be done to read or write external SD files in Android?


 · A) Use SharedPreferences
 B) Modify AndroidManifest.xml
 C) Use SQLiteOpenHelper
 D) Use internal storage
 Correct Answer: B

· What is a key characteristic of SQLite in Android?

 · A) Requires complex setup


 B) Always requires a network connection
 C) Embedded in every Android device
 D) Only available on rooted devices
 Correct Answer: C

· Which class must be extended to create and upgrade an SQLite database in


Android?

 · A) SQLiteDatabase
 B) SQLiteOpenHelper
 C) SQLiteManager
 D) SQLiteContentProvider
 Correct Answer: B

· Which method is called only when creating an SQLite database for the first
time?

 · A) onStart()
 B) onCreate()
 C) onInit()
 D) onFirstRun()
 Correct Answer: B

· Which method is called when the database version is increased in the


application code?

 · A) onUpdate()
 B) onUpgrade()
 C) onChange()
 D) onModify()
 Correct Answer: B

· What does the getReadableDatabase() method return?

 · A) A writable database object


 B) A read-only database object
 C) A configuration file
 D) A temporary database object
 Correct Answer: B

· What is the first step to adding a database in an Android application?

 · A) Define Fields
 B) Override the Constructor
 C) Create a Class that extends SQLiteOpenHelper
 D) Perform CRUD operations
 Correct Answer: C

· Which class is used to insert values into an SQLite database?

 · A) ContentProvider
 B) ContentValues
 C) ValueInserter
 D) DatabaseWriter
 Correct Answer: B

· Which method is used to delete a row from an SQLite database?

 · A) removeRow()
 B) delete()
 C) dropRow()
 D) erase()
 Correct Answer: B

· How is data typically saved in SharedPreferences?

 · A) As JSON objects
 B) As XML files
 C) As key-value pairs
 D) As binary data
 Correct Answer: C

· What is the purpose of the SQLiteOpenHelper class?

 · A) To manage network connections


 B) To handle user interface design
 C) To create, update, and manage databases
 D) To perform file I/O operations
 Correct Answer: C

Chapter 05: Location and Maps

1.

Which class provides access to the system location services in Android?

2.
1. A) LocationProvider
2. B) LocationManager
3. C) LocationService
4. D) Geocoder
5. Correct Answer: B) LocationManager
3.
What is the main purpose of the Geocoder class in Android?

4.

1. A) To find the current location of the device


2. B) To translate between street addresses and latitude/longitude coordinates
3. C) To display maps
4. D) To handle location permissions
5. Correct Answer: B) To translate between street addresses and latitude/longitude
coordinates

5.

Which provider is used for location services based on GPS in Android?

6.

1. A) NETWORK_PROVIDER
2. B) PASSIVE_PROVIDER
3. C) GPS_PROVIDER
4. D) WIFI_PROVIDER
5. Correct Answer: C) GPS_PROVIDER

7.

Which method is used to get the last known location from a


LocationProvider?

8.

1. A) getLastKnownPosition()
2. B) getLastKnownLocation()
3. C) getCurrentLocation()
4. D) getLocation()
5. Correct Answer: B) getLastKnownLocation()

9.

What permissions are required for accessing fine location in Android?

10.

1. A) ACCESS_COARSE_LOCATION
2. B) ACCESS_FINE_LOCATION
3. C) ACCESS_NETWORK_STATE
4. D) ACCESS_WIFI_STATE
5. Correct Answer: B) ACCESS_FINE_LOCATION
11.

Which technology does NOT provide localization services in Android?

12.

1. A) GPS
2. B) Wi-Fi
3. C) Bluetooth
4. D) Cellular Network
5. Correct Answer: C) Bluetooth

13.

What is the function of the getBestProvider method in LocationManager?

14.

1. A) To return the best available location provider based on given criteria


2. B) To start GPS services
3. C) To stop network location updates
4. D) To initialize the Geocoder
5. Correct Answer: A) To return the best available location provider based on given
criteria

15.

In which file should the API key for Google Maps be included in an
Android project?

16.

1. A) strings.xml
2. B) build.gradle
3. C) AndroidManifest.xml
4. D) MainActivity.java
5. Correct Answer: C) AndroidManifest.xml

17.

What does the ACCESS_FINE_LOCATION permission allow in


Android?

18.

1. A) Access to coarse location


2. B) Access to fine location (GPS)
3. C) Access to the Internet
4. D) Access to the phone state
5. Correct Answer: B) Access to fine location (GPS)

19.

What class is used to request location updates in Android?

20.

1. A) LocationRequest
2. B) LocationManager
3. C) LocationProvider
4. D) Geocoder
5. Correct Answer: B) LocationManager

21.

Which method in the Geocoder class is used for reverse geocoding?

22.

1. A) getFromLocation()
2. B) getFromLocationName()
3. C) getAddress()
4. D) getCoordinates()
5. Correct Answer: A) getFromLocation()

23.

What is the main use of the Criteria class in the context of location-based
services?

24.

1. A) To specify the requirements for selecting a location provider


2. B) To handle geocoding tasks
3. C) To start and stop location updates
4. D) To manage API keys
5. Correct Answer: A) To specify the requirements for selecting a location provider

25.

Which method is used to get periodic location updates in Android?

26.

1. A) requestLocationUpdates()
2. B) getLastKnownLocation()
3. C) getLocation()
4. D) updateLocation()
5. Correct Answer: A) requestLocationUpdates()

27.

What does the method getProviders(boolean enabledOnly) return in


LocationManager?

28.

1. A) A list of all available providers


2. B) A list of enabled providers
3. C) A list of disabled providers
4. D) A list of default providers
5. Correct Answer: B) A list of enabled providers

29.

Which of the following is NOT a location provider in Android?

30.

1. A) GPS_PROVIDER
2. B) NETWORK_PROVIDER
3. C) PASSIVE_PROVIDER
4. D) WIFI_PROVIDER
5. Correct Answer: D) WIFI_PROVIDER

31.

What type of data does the getFromLocationName method of the


Geocoder class return?

32.

1. A) List of coordinates
2. B) List of addresses
3. C) Single address
4. D) Single coordinate
5. Correct Answer: B) List of addresses

33.

Which Android component provides access to the system location


services?

34.
1. A) LocationProvider
2. B) LocationService
3. C) LocationManager
4. D) Geocoder
5. Correct Answer: C) LocationManager

35.

In the context of Android maps, what is the purpose of an API key?

36.

1. A) To authenticate the application with Google services


2. B) To enable GPS on the device
3. C) To manage network connections
4. D) To store location data
5. Correct Answer: A) To authenticate the application with Google services

37.

What is the main benefit of using the getBestProvider method?

38.

1. A) It provides the fastest location provider


2. B) It selects the most accurate provider based on given criteria
3. C) It disables unnecessary providers
4. D) It updates the current location automatically
5. Correct Answer: B) It selects the most accurate provider based on given criteria

39.

Which permission is required for using the NETWORK_PROVIDER for


location services?

40.

1. A) ACCESS_FINE_LOCATION
2. B) ACCESS_COARSE_LOCATION
3. C) INTERNET
4. D) ACCESS_NETWORK_STATE
5. Correct Answer: B) ACCESS_COARSE_LOCATION

41.

What does the method getFromLocation return when the Geocoder


cannot resolve any addresses for the specified coordinate?
42.

1. A) An empty list
2. B) null
3. C) A default address
4. D) An exception
5. Correct Answer: B) null

43.

Which component should be used to display maps in an Android


application?

44.

1. A) LocationManager
2. B) GoogleMap
3. C) MapView
4. D) Geocoder
5. Correct Answer: C) MapView

45.

Which of the following methods is used to enable geolocation in an


Android app?

46.

1. A) enableLocation()
2. B) requestLocationUpdates()
3. C) startLocationService()
4. D) beginLocationTracking()
5. Correct Answer: B) requestLocationUpdates()

47.

How do you specify the accuracy level in the Criteria class?

48.

1. A) setAccuracyLevel()
2. B) setAccuracy()
3. C) setPrecision()
4. D) setLevel()
5. Correct Answer: B) setAccuracy()

49.
What should be included in the manifest to use the Google Maps library
in an Android app?

50.

1. A) <uses-library android:name="com.google.android.maps"/>
2. B) <uses-permission android:name="android.permission.MAPS"/>
3. C) <meta-data android:name="com.google.android.maps"/>
4. D) <application android:name="com.google.android.maps"/>
5. Correct Answer: A) <uses-library android:name="com.google.android.maps"/>

51.

Which method is used to find the best location provider based on


specified criteria?

52.

1. A) getProvider()
2. B) getBestProvider()
3. C) getCriteriaProvider()
4. D) getOptimalProvider()
5. Correct Answer: B) getBestProvider()

53.

What is required to perform geocoding operations in an Android


application?

54.

1. A) NETWORK_PROVIDER
2. B) LocationManager
3. C) Geocoder
4. D) MapView
5. Correct Answer: C) Geocoder

55.

What method would you use to perform forward geocoding in Android?

56.

1. A) getFromLocation()
2. B) getFromLocationName()
3. C) getAddress()
4. D) getCoordinates()
5. Correct Answer: B) getFromLocationName()
57.

What is the primary use of the LocationManager class?

58.

1. A) To handle geocoding
2. B) To manage location providers and location updates
3. C) To display maps
4. D) To manage API keys
5. Correct Answer: B) To manage location providers and location updates

59.

What Android permission is necessary for accessing both GPS and


network-based location providers?

60.

1. A) ACCESS_FINE_LOCATION
2. B) ACCESS_COARSE_LOCATION
3. C) ACCESS_NETWORK_STATE
4. D) ACCESS_WIFI_STATE
5. Correct Answer: A) ACCESS_FINE_LOCATION

61.

Which of the following is NOT a method of the LocationManager class?

62.

1. A) requestLocationUpdates()
2. B) getLastKnownLocation()
3. C) getFromLocationName()
4. D) getBestProvider()
5. Correct Answer: C) getFromLocationName()

63.

Which attribute in AndroidManifest.xml specifies the use of the Google


Maps library?

64.

1. A) <uses-library android:name="com.google.android.maps"/>
2. B) <uses-permission android:name="android.permission.MAPS"/>
3. C) <meta-data android:name="com.google.android.maps"/>
4. D) <application android:name="com.google.android.maps"/>
5. Correct Answer: A) <uses-library android:name="com.google.android.maps"/>

65.

What is the default method to get the current location in Android if the
device has multiple providers?

66.

1. A) getBestProvider()
2. B) requestLocationUpdates()
3. C) getLastKnownLocation()
4. D) getProvider()
5. Correct Answer: A) getBestProvider()

67.

In the context of Android, what is a LocationProvider?

68.

1. A) A component that displays maps


2. B) A service that handles geocoding
3. C) A source of geographic location data
4. D) A manager for location permissions
5. Correct Answer: C) A source of geographic location data

69.

What does the term 'geofencing' refer to in location-based services?

70.

1. A) Mapping geographic boundaries


2. B) Setting up a virtual perimeter for a real-world geographic area
3. C) Drawing fences on maps
4. D) Tracking user movements
5. Correct Answer: B) Setting up a virtual perimeter for a real-world geographic area

71.

What is required to convert latitude and longitude into a street address in


Android?

72.

1. A) LocationManager
2. B) MapView
3. C) Geocoder
4. D) GoogleMap
5. Correct Answer: C) Geocoder

73.

Which of the following can affect the accuracy of location updates?

74.

1. A) The type of LocationProvider


2. B) The frequency of updates
3. C) Environmental factors like buildings and weather
4. D) All of the above
5. Correct Answer: D) All of the above

75.

How does the Geocoder handle reverse geocoding failures?

76.

1. A) Returns a default address


2. B) Throws an exception
3. C) Returns null
4. D) Logs an error and continues
5. Correct Answer: C) Returns null

77.

In which scenario would you use the PASSIVE_PROVIDER in Android?

78.

1. A) When precise location is needed frequently


2. B) To get location updates without initiating location services
3. C) For mapping and navigation applications
4. D) For high-accuracy requirements
5. Correct Answer: B) To get location updates without initiating location services

79.

What element must be added to AndroidManifest.xml to request location


permissions?

80.
1. A) <uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
2. B) <uses-permission android:name="android.permission.MAPS"/>
3. C) <uses-library android:name="com.google.android.maps"/>
4. D) <application android:name="com.google.android.maps"/>
5. Correct Answer: A) <uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>

You might also like