AAD App Functionality & Behavior — Questions and Answers
Question 1: Which method is used to start a new Activity in an Android application?
- startNewActivity()
- launchActivity()
- beginActivity()
- startActivity() (Correct answer)
Correct answer: startActivity()
startActivity() is used to launch a new Activity from another Activity within an Android application.
Question 2: Which lifecycle method is called when an Activity becomes visible to the user?
- onResume()
- onPause()
- onStart() (Correct answer)
- onDestroy()
Correct answer: onStart()
The onStart() method is triggered when an Activity becomes visible but is not yet in the foreground.
Question 3: Which component is responsible for handling background tasks in an Android app?
- BroadcastReceiver
- ContentProvider
- Service (Correct answer)
- Activity
Correct answer: Service
A Service is used to perform long-running operations in the background without direct user interaction.
Question 4: Which Android component allows an app to send and receive messages globally within the system?
- Service
- Activity
- BroadcastReceiver (Correct answer)
- Intent
Correct answer: BroadcastReceiver
A BroadcastReceiver listens for system-wide broadcast messages and can respond to various system events.
Question 5: What is the purpose of an Intent in Android?
- To create a new database
- To define UI components
- To request an action from another component (Correct answer)
- To manage permissions
Correct answer: To request an action from another component
Intents are used to request an action from another component, such as starting an Activity or Service.
Question 6: Which Android component is responsible for managing and storing structured data?
- Activity
- Service
- BroadcastReceiver
- ContentProvider (Correct answer)
Correct answer: ContentProvider
A ContentProvider manages access to structured data and is used for sharing data between applications.
Which method is used to start a new Activity in an Android application?