Weekend Sale Special - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: top65certs

Pass Using Associate-Android-Developer Exam Dumps

Google Developers Certification - Associate Android Developer (Kotlin and Java Exam) Questions and Answers

Question 17

What do you want from Room when you create a DAO method and annotate it with @Update?

Example:

@Dao

interface MyDao {

@Update

fun updateUsers(vararg users: User)

}

Options:

A.

Room generates an implementation that inserts all parameters into the database in a single transaction.

B.

Room modifies a set of entities, given as parameters, in the database. It uses a query that matches against the primary key of each entity.

C.

Room removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.

Question 18

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?

Options:

A.

delete(String key)

B.

clear()

C.

remove(String key)

D.

removeAll()

Question 19

What happens when you create a DAO method and annotate it with @Insert?

Example:

@Dao

interface MyDao {

@Insert(onConflict = OnConflictStrategy.REPLACE)

fun insertUsers(vararg users: User)

}

Options:

A.

Room generates an implementation that inserts all parameters into the database in a single transaction.

B.

Room modifies a set of entities, given as parameters, in the database. It uses a query that matches against the primary key of each entity.

C.

Room removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.