Google Associate Android Developer Practice Test - Questions Answers, Page 9
List of questions
Related questions
Question 81
What do you want from Room when you create a DAO method and annotate it with @Update?
Example:
@Dao
public interface MyDao { @Update
public void updateUsers(User... users); }
Question 82
What do you want from Room when you create a DAO method and annotate it with @Delete?
Example:
@Dao
public interface MyDao { @Delete
public void deleteUsers(User... users); }
Question 83
In Android 8.0, API level 26, some APIs regarding notification behaviors were moved from Notification to NotificationChannel. For example, what should we use instead of NotificationCompat.Builder.setPriority() for Android 8.0 and higher?
Explanation:
Reference:
https://developer.android.com/training/notify-user/build-notification
Question 84
What method should we use with Notification.Builder to supply a PendingIntent to be sent when the notification is clicked?
Explanation:
Reference:
https://developer.android.com/training/notify-user/build-notification
Question 85
When scheduling unique work, you must tell WorkManager what action to take when there is a conflict. You do this by passing an enum when enquing the work.
For one-time work, you provide an ExistingWorkPolicy, which supports some options for handling the conflict. (Choose four.)
Explanation:
Videos:
Working with WorkManager, from the 2018 Android Dev Summit
WorkManager: Beyond the basics, from the 2019 Android Dev Summit
Reference: https://developer.android.com/reference/androidx/work/WorkManager?hl=en
Question 86
If you are working with a Builder that creates a PeriodicWorkRequest to run periodically once within the flex period of every interval period. What statement is correct?
Explanation:
Videos:
Working with WorkManager, from the 2018 Android Dev Summit
WorkManager: Beyond the basics, from the 2019 Android Dev Summit
Reference: https://developer.android.com/reference/androidx/work/WorkManager?hl=en
Question 87
Custom duration in milliseconds as a parameter for the setDuration method is available when you are working with:
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/notifiers/toasts https://developer.android.com/training/snackbar/action
Question 88
If constant LENGTH_INDEFINITE is used as a parameter for the setDuration method in Snackbar, what will happen?
Explanation:
Reference: https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar#LENGTH_INDEFINITE https://developer.android.com/guide/topics/ui/notifiers/toasts https://developer.android.com/training/snackbar/action
Question 89
What public methods are there in android.widget.Toast.Callback? (Choose two.)
Question 90
Which build options in the Build menu to choose to delete all intermediate/cached build files.
Question