Kotlin Fundamentals: Databases and RecyclerView quiz Return to pathway How can you verify that your database is working as expected? Select all that apply. Choose as many answers as you see fit. Write instrumented unit tests. Wait until the app displays the data. Replace the calls to the methods in the DAO interface by calls to equivalent methods in the Entity class. Run the verifyDatabase() function provided by the Room library. How do you indicate that a class represents an entity to store in a Room database? Make the class extend DatabaseEntity. Annotate the class with @Entity. Annotate the class with @Database. Make the class extend RoomEntity and also annotate the class with @Room. Which of the following is not true of coroutines? They are non blocking. They run asynchronously. They can be run on a thread other than the main thread. They always make app runs faster. They propagate exceptions. They can be written and read as linear code. Which of the following statements is not true? When execution is blocked, no other work can be executed on the blocked thread. When execution is suspended, the thread can do other work while waiting for the offloaded work to complete. Suspending saves memory over blocking while supporting many concurrent operations. Whether blocked or suspended, execution is still waiting for the result of the coroutine before continuing. How does RecyclerView display items? Select all that apply. Choose as many answers as you see fit. It displays items in a list or a grid. It scrolls vertically or horizontally. It scrolls diagonally on larger devices, such as tablets. It allows custom layouts when a list or a grid is not enough for the use case. Which of the following are necessary to use DiffUtil? Select all that apply. Choose as many answers as you see fit. Extend the ItemCallback class. Override areItemsTheSame(). Override areContentsTheSame(). Use data binding to track the differences between items. Which of the following are layout managers provided by Android? Select all that apply. Choose as many answers as you see fit. LinearLayoutManager GridLayoutManager CircularLayoutManager StaggeredGridLayoutManager Where do you add the android:onClick attribute to make items in a RecyclerView respond to clicks? In the layout file that displays the RecyclerView, add it to the <androidx.recyclerview.widget.RecyclerView> element. Add it to the layout file for an item in the row. If you want the entire item to be clickable, add it to the parent view that contains the items in the row. Add the android:onClick attribute onto the RecyclerView.Adapter. Always add it to the layout file for the MainActivity. Which of the following statements is true about ViewHolder? An adapter can use multiple ViewHolder classes to hold headers and various types of data. You can have exactly one view holder for data and one view holder for a header. A RecyclerView supports multiple types of headers, but the data has to be uniform. When adding a header, you subclass RecyclerView to insert the header at the correct position. Submit answers error_outline An error occurred when grading the quiz. Please try again.