Free ASSOCIATE ANDROID DEVELOPER Exam Braindumps
Associate Android Developer Questions 51–55 (page: 12)

Updated On: 10-Feb-2026

SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. All changes you make in an editor are batched, and not copied back to the original SharedPreferences until you call:

  1. commit()
  2. apply()
  3. commit() or apply()

Answer(s): C



SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. To mark in the editor that a preference value should be removed, which will be done in the actual preferences once commit() or apply() is called, what method in SharedPreferences.Editor should we use?

  1. delete(String key)
  2. clear()
  3. remove(String key)
  4. removeAll()

Answer(s): B

Explanation:

clear() method marks in the editor to remove ALL values from the preferences. Once commit is called, the only remaining preferences will be any that you have defined in this editor.
And no delete and removeAll method exists in SharedPreferences.Editor



What is the incorrect statement about Data Access Object (androidx.room.Dao)?

  1. Data Access Objects are the main classes where you define your database interactions. They can include a variety of query methods.
  2. The class marked with @Dao should either be an interface or an abstract class. At compile time, Room will generate an implementation of this class when it is referenced by a Database.
  3. An abstract @Dao class can optionally have a constructor that takes a Database as its only parameter.
  4. It is recommended to have only one Dao class in your codebase for all tables.

Answer(s): D



By adding a RoomDatabase.Callback to the room database builder RoomDatabase.Builder (method
addCallback(RoomDatabase.Callback callback)), we can: (Choose two.)

  1. set the database factory
  2. handle database first time creation
  3. handle database opening
  4. disable the main thread query check for Room

Answer(s): B,C



By executing an allowMainThreadQueries() method to the room database builder
RoomDatabase.Builder, we can:

  1. set the database factory
  2. handle database first time creation
  3. handle database opening
  4. disable the main thread query check for Room

Answer(s): D



Viewing page 12 of 27
Viewing questions 56 - 60 out of 128 questions


Post your Comments and Discuss Google ASSOCIATE ANDROID DEVELOPER exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!