Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

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

The Testing Pyramid, shown in the Figure, illustrates how your app should include the three categories of tests: small, medium, and large. Small tests are unit tests that :

A.

validate your app's behavior one class at a time.

B.

validate either interactions between levels of the stack within a module, or interactions between related modules.

C.

validate user journeys spanning multiple modules of your app.

The Log class allows you to create log messages that appear in logcat. Generally, you could use the following log methods: (Choose five.)

A.

Log.e(String, String) (error)

B.

Log.a(String, String) (all outputs)

C.

Log.w(String, String) (warning)

D.

Log.i(String, String) (information)

E.

Log.q(String, String) (QUESTION NO:s)

F.

Log.d(String, String) (debug)

G.

Log.v(String, String) (verbose)

The Testing Pyramid, shown in the Figure, illustrates how your app should include the three categories of tests: small, medium, and large. Medium tests are integration tests that:

A.

validate your app's behavior one class at a time.

B.

validate either interactions between levels of the stack within a module, or interactions between related modules.

C.

validate user journeys spanning multiple modules of your app.

For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:

android:title="@string/pref_sort_title" android:summary="@string/pref_sort_summary" android:dialogTitle="@string/pref_sort_dialog_title" android:entries="@array/sort_oder" android:entryValues="@array/sort_oder_value" android:defaultValue="@string/pref_default_sort_value" app:iconSpaceReserved="false" />

In our Fragment, we can dynamically get current notification preference value in this way:

A.

val sortBy = PreferenceManager.getDefaultSharedPreferences(context).getString( context!!.getString(R.string.pref_sort_key), context!!.resources.getBoolean(R.bool.pref_default_sort_value)

)

B.

val sortBy = PreferenceManager.getSharedPreferences(context).getString( context!!.getString(R.string.pref_default_sort_value), context!!.getString(R.string.pref_sort_key),

)

C.

val sortBy = PreferenceManager.getSharedPreferences(context).getBoolean( context!!.resources.getBoolean(R.bool.pref_default_sort_value), context!!.getString(R.string.pref_sort_key)

)

D.

val sortBy = PreferenceManager.getDefaultSharedPreferences(context).getString( context!!.getString(R.string.pref_sort_key), context!!.getString(R.string.pref_default_sort_value)

)

When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can then use the tools in the Debugger tab to identify the state of the app. With Evaluate Expression you can

A.

examine the object tree for a variable; expand it in the Variables view

B.

evaluate an expression at the current execution point

C.

advance to the next line in the code (without entering a method)

D.

advance to the first line inside a method call

E.

advance to the next line outside the current method

F.

continue running the app normally

If you want to access a specific UI component in an app, use the UiSelector class. This class represents a query for specific elements in the currently displayed UI. What is correct about it? (Choose two.)

A.

If more than one matching element is found, the first matching element in the layout hierarchy is returned as the target UiObject.

B.

If no matching UI element is found, an IOException is thrown.

C.

If more than one matching element is found, the last matching element in the layout hierarchy is returned as the target UiObject.

D.

If no matching UI element is found, a UiAutomatorObjectNotFoundException is thrown.

As an example. In an Activity we have our TimerViewModel object (extended ViewModel), named mTimerViewModel. mTimerViewModel.timer method returns a LiveData value. What can be a correct way to set an observer to change UI in case if data was changed?

A.

mTimerViewModel!!.timer.value.toString().observe

(Observer { aLong -> callAnyChangeUIMethodHere(aLong!!) })

B.

mTimerViewModel!!.timer.observe

(this, Observer { aLong -> callAnyChangeUIMethodHere(aLong!!) })

C.

mTimerViewModel.observe

(Observer { aLong -> callAnyChangeUIMethodHere(aLong!!) })

Select four different types of app components. (Choose four.)

A.

Application

B.

Layouts

C.

Activities

D.

Services

E.

AlarmManager

F.

WorkManager

G.

Broadcast receivers

To automate UI tests with Android Studio, you implement your test code in a separate Android test folder. Folder could be named:

A.

app/androidTest/java

B.

app/src/androidTest/java

C.

app/java/androidTest

Custom views and directional controller clicks. In general, you should send an AccessibilityEvent whenever the content of your custom view changes. For example, if a text value was changed in your custom view, you should emit an event of this type:

A.

TYPE_WINDOWS_CHANGED

B.

TYPE_VIEW_CONTEXT_CLICKED

C.

TYPE_WINDOWS_CHANGED

D.

TYPE_VIEW_TEXT_CHANGED