Find Content

Android App Components – Intents, Activities, and Broadcast Receivers Quiz Answers

All Weeks Android App Components – Intents, Activities, and Broadcast Receivers Quiz Answers

Week 2: Android App Components – Intents, Activities, and Broadcast Receivers Quiz Answers

Quiz 1: Module 3 Quiz

Q1. Which of the following correctly describe what an intent is in Android (choose all that apply):

  • A message that describes an action to perform or an event that has occurred
  • An event handler that responds to system-side broadcast announcements
  • A message that provides a screen within which users can interact in order to do something
  • A component that runs in the background to perform long-running operations or access remote resources

Q2. Which of the following correctly describe benefits that an intent provides to apps in Android (choose all that apply):

  • An intent is the “glue” that helps integrate Android apps
  • An intent manages secure access to structured data
  • An intent simplifies app development since existing components can be reused as “black-boxes”
  • An intent defines the smallest unit of execution for sequences of programmed instructions

Q3. Which of the following correctly describe what is meant by an intent being a “passive” data structure (choose all that apply):

  • An intent just consists of fields and field access/mutator methods
  • An intent only contains public fields
  • An intent only contains static getter/setter methods
  • An intent cannot be used in a concurrent program

Q4. Which of the following correctly describe what is meant by an intent enabling “late runtime binding” of apps to components (choose all that apply):

  • App components started by intents are slow to launch
  • App components can be discovered and used at compile-time vs. runtime
  • App components can be discovered and used at runtime vs compile-time
  • App components started by intents must run in separate processes

Q5. Which of the following correctly describe the benefits of runtime discovery of app component (choose all that apply):

  • It enables apps with loosely-coupled components that can be extended and integrated dynamically
  • It enhances the security and robustness of apps by disallowing trojan horses
  • It enables systematic reuse that creates apps from predefined software components
  • It ensures that developers know at compile-time which component implementations their app will use

Q6. Which of the following are elements in an Android intent (choose all that apply):

  • Name
  • Extras
  • URL
  • Data
  • Service
  • Flags
  • Stack
  • Action

Q7. Which of the following statements are true for an “implicit” intent (choose all that apply):

  • The category must not be specified
  • The name must not be specified
  • The action must not be specified
  • The data must not be specified

Q8. Which of the following are true statements about implicit and explicit intent (choose all that apply):

  • Explicit intents are typically used to interact with components residing in other apps
  • Implicit intents are used to “tightly couple” activity and broadcast receiver components
  • Implicit intents are typically used to interact with components residing in other apps
  • Android delivers an implicit intent to a target component only if it matches one of its intent filters in the AndroidManifest.xml file
  • Explicit intents are particularly important when starting or binding to services
  • Android delivers an explicit intent to a target component without consulting filters in the AndroidManifest.xml file

Q9. Which of the following elements must match during implicit intent filtering for an intent to be delivered to a target component (choose all that apply):

  • Data
  • Extras
  • Name
  • Action
  • Category
  • Flags

Q10. Which of the following correctly describe what Android’s IntentService does (choose all that apply):

  • It is a component that provides a screen within which users can interact in order to do something
  • It expresses requests as intents & passes them between threads and/or processes
  • It’s a framework that handles asynchronous requests on demand
  • It is an event handler that responds to system-side broadcast announcement

Week 3: Android App Components – Intents, Activities, and Broadcast Receivers Quiz Answers

Quiz 1: Module 4 Quiz

Q1. Which of the following correctly describe what an activity is in Android (choose all that apply):

  • A component that runs in the background to perform long-running operations or access remote resources
  • A message that describes an action to perform or an event that has occurred
  • A component that defines a user-facing operation that’s displayed on a device screen
  • An event handler that responds to system-side broadcast announcements

Q2. Which of the following correctly define what a hook method is (choose all that apply):

  • It is the smallest unit of execution for sequences of programmed instructions
  • It is an event handler that responds to broadcast announcements
  • It is used to customize reusable framework classes to run app-specific logic
  • It is an unnamed block of code that can be passed around and executed later

Q3. Which of the following are lifecycle hook methods provided by Android’s activity framework (choose all that apply):

  • onPause()
  • onDestroy()
  • onStop()
  • onReceive()
  • onBind()
  • onCreate()
  • onResume()
  • onStart()

Q4. Which of the following statements about the startActivityForResult() method are true (choose all that apply):

  • This method is asynchronous and two-way
  • This method is asynchronous and one-way
  • This method is synchronous and two-way
  • This method is synchronous and one-way

Q5. Which of the following lifecycle hook methods may not be called in low memory situations (choose all that apply):

  • onDestroy()
  • onResume()
  • onPause()
  • onStop()

Q6. Which of the following Android system services call lifecycle hook methods on activities, services, and broadcast receivers (choose all that apply):

  • Window Manager Service
  • Location Manager Service
  • Notification Manager Service
  • Activity Manager Service

Q7. Which of the following statements accurately reflect what happens when a user enters text via the Android virtual keyboard (choose all that apply):

  • A new activity is started and its onCreate() hook method is called
  • The onResume() hook method is called back to return UI focus for this screen
  • The UI focus is unchanged and no lifecycle hook methods are called
  • The onStart() hook method is called back and the activity becomes visible

Q8. Which of the following correctly define what a “task” is in the contact of Android activities (choose all that apply):

  • It is a component that runs in the background performing long-running operations or accessing remote resources
  • It is a unit of execution for sequences of programmed instructions
  • It is a group of activities a user interacts with when performing a certain job
  • It is an unnamed block of code that can be passed around and executed later

Q9. Which of the following correctly describe how activities can be used in concurrent apps (choose all that apply):

  • Any long-duration operations must run in background threads via concurrency frameworks
  • An activity cannot be used in a concurrent app
  • UI toolkit components should only be accessed by the UI thread
  • All methods called in the UI thread must be short-duration and non-blocking

Q10. Which of the following correctly describes the capabilities of the Android HaMeR framework (choose all that apply):

  • It enables operations to run in one or more background threads and publish results to the UI thread without directly using threads, handlers, messages, and/or runnables
  • It is a component that runs in the background to perform long-running operations or access remote resources
  • It handles asynchronous requests on demand and expresses these requests as intents that are passed between threads and/or processes
  • It enables operations to run in one or more background threads and publish results to the UI thread

Week 4: Android App Components – Intents, Activities, and Broadcast Receivers Quiz Answers

Quiz 1: Module 5 Quiz

Q1. Which of the following correctly describe what a broadcast receiver is in Android (choose all that apply):

  • An event handler that responds to broadcast announcements
  • A component that defines a user-facing operation that’s displayed on a device screen
  • A message that describes an action to perform or an event that has occurred
  • A component that runs in the background to perform long-running operations or access remote resources

Q2. Which of the following Android system services are involved in routing intents to broadcast receivers (choose all that apply):

  • Telephony Manager Service
  • Window Manager Service
  • Activity Manager Service
  • Download Manager Service

Q3. Which of the following things can be done in receiver’s onReceive() hook method (choose all that apply):

  • Create status bar notifications
  • Start other Android components
  • Pop up toast messages
  • Show a dialog
  • Bind to a service
  • Register other receivers

Q4. Which of the following are types of Android intent broadcast mechanisms (choose all that apply):

  • Static
  • Ordered
  • Dynamic
  • Async
  • Sticky
  • Normal

Q5. Which of the following are reasons why broadcasting intents raises security issues (choose all that apply):

  • An app can send an intent to any receiver registered via registerReceiver or the AndroidManifest.xml file
  • The intent namespace is global
  • The onReceive() hook method in a receiver is called back in the UI thread
  • sendBroadcast() allows any other app to receive broadcast intents

Q6. Which of the following are key differences between the PingPongReceivers and PingPongReceiversEx apps (choose all that apply):

  • The PingPongReceivers app uses setPackage() to limit receivers to its components only, whereas the PingPongReceiversEx app does not.
  • The PingPongReceivers app displays “ping” and “pong” strings via toasts instead of via the notification status bar area.
  • The PongReceiver in PingPongReceivers runs in a different process as the MainActivity, whereas the PongReceiver in PingPongReceiversEx runs in the same process as MainActivity.
  • The PingPongReceiversEx app displays “ping” and “pong” strings via toasts instead of via the notification status bar area.

Q7. Which of the following statements are correct with respect to the capabilities provided by Android’s LocalBroadcastManager (choose all that apply):

  • It uses the Activity Manager Service to efficiently route intents to zero or more components
  • It enhances app security by ensuring intents can’t be sent or received by components in other apps
  • It performs optimizations for intra-app communication by ensuring intents don’t cross process boundaries
  • It allows broadcast receivers to run in the background performing long-running operations and/or accessing remote resources

Q8. Which of the following are key differences between the ImageDownloaderBRD and ImageDownloaderBRS apps (choose all that apply):

  • ImageDownloaderBRS uses the Activity Manager Service to route intents, whereas ImageDownloaderBRD uses the LocalBroadcastManager
  • ImageDownloaderBRS uses the LocalBroadcastManager to route intents, whereas ImageDownloaderBRD uses the Activity Manager Service
  • ImageDownloaderBRS uses SharedPreferences to communicate between the DownloadReceiver and the MainActivity, whereas ImageDownloaderBRD uses a boolean to communicate between the DownloadReceiver and the MainActivity.
  • The DownloadReceiver in ImageDownloaderBRS runs in a different process as the MainActivity, whereas the DownloadReceiver in ImageDownloaderBRD runs in the same process as MainActivity.
Conclusion:

I hope this Android App Components – Intents, Activities, and Broadcast Receivers Coursera Quiz Answers would be useful for you to learn something new from the Course. If it helped you, don’t forget to bookmark our site for more Quiz Answers.

This course is intended for audiences of all experiences who are interested in learning about new skills in a business context; there are no prerequisite courses.

Keep Learning!

Ezoic

Leave a Reply

Your email address will not be published. Required fields are marked *