Google Associate-Android-Developer - Google Developers Certification - Associate Android Developer (Kotlin and Java Exam)
Total 128 questions
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?
When using an ImageView, ImageButton, CheckBox, or other View that conveys information graphically. What attribute to use to provide a content label for that View?
For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:
android:title="@string/pref_notification_title" android:summary="@string/pref_notification_summary" android:defaultValue="@bool/pref_notification_default_value" app:iconSpaceReserved="false"/> In our Fragment, we can dynamically get current notification preference value in this way:
For example, suppose that in a XML file (res/menu/menu_main.xml as an example), where menu items are described, we have such item:
...
android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string/menu_action_settings" app:showAsAction="never" /> ... Attribute “app:showAsAction†shows when and how this item should appear as an action item in the app bar. What value “never†in this attribute means?
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);
}
What method should we use with Notification.Builder to supply a PendingIntent to be sent when the notification is clicked?
Move the major components of the Android platform to correct places in diagram.
For example, we have a BufferedReader reader, associated with the json file through
InputStreamReader. To get a file data we can do this:
In general, you should send an AccessibilityEvent whenever the content of your custom view changes. For example, if you are implementing a custom slider bar that allows a user to select a numeric value by pressing the left or right arrows, your custom view should emit an event of type TYPE_VIEW_TEXT_CHANGED whenever the slider value changes. Which one of the following sample codes demonstrates the use of the sendAccessibilityEvent() method to report this event.
In our TeaViewModel class, that extends ViewModel, we have such method:
public LiveData
}
An observer in our Activity (type of mViewModel variable in example is TeaViewModel) is set in this way:
mViewModel.getTea().observe(this, this::displayTea);
What will be a correct displayTea method definition?