Google Associate Android Developer Practice Test - Questions Answers, Page 6
List of questions
Related questions
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:
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?
What is the incorrect statement about Data Access Object (androidx.room.Dao)?
By adding a RoomDatabase.Callback to the room database builder RoomDatabase.Builder (method addCallback(RoomDatabase.Callback callback)), we can: (Choose two.)
By executing an allowMainThreadQueries() method to the room database builder RoomDatabase.Builder, we can:
Room can export your database's schema information into a JSON file at compile time. What annotation processor property you should set in your app/build.gradle file to export the schema?
If you added to your build.gradle file a room.schemaLocation:
android { defaultConfig { javaCompileOptions { annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}}
Then, you build your app or module.
As a result you got a json file, with such path to it:
app/schemas/your_app_package/db_package/DbClass/DB_VERSION.json
What are the correct statements about this file? (Choose all that apply.)
Select 3 major components of the Room. (Choose three.)
A class that you create for managing multiple data sources. In addition to a Room database, this class could manage remote data sources such as a web server. It is about:
@Query is the main annotation used in DAO classes. It allows you to perform read/write operations on a database. Each @Query method is verified at compile time, so what happens if there is a problem with the query?
Question