Pass4itsure > Google > Google Certifications > ASSOCIATE-ANDROID-DEVELOPER > ASSOCIATE-ANDROID-DEVELOPER Online Practice Questions and Answers

ASSOCIATE-ANDROID-DEVELOPER Online Practice Questions and Answers

Questions 4

DRAG DROP

Under the hood WorkManager uses an underlying job dispatching service based on the following criteria. You need to move services to the correct places.

Select and Place:

Buy Now
Questions 5

The following code snippet shows an example of an Espresso test:

A. @Rule

fun greeterSaysHello() {

onView(withId(R.id.name_field)).do(typeText("Steve"))

onView(withId(R.id.greet_button)).do(click())

onView(withText("Hello Steve!")).check(matches(isDisplayed()))

}

B. @Test

fun greeterSaysHello() {

onView(withId(R.id.name_field)).perform(typeText("Steve"))

onView(withId(R.id.greet_button)).perform(click())

onView(withText("Hello Steve!")).check(matches(isDisplayed()))

}

C. @Test

fun greeterSaysHello() {

onView(withId(R.id.name_field)).do(typeText("Steve"))

onView(withId(R.id.greet_button)).do(click())

onView(withText("Hello Steve!")).compare(matches(isDisplayed()))

}

Buy Now
Questions 6

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.

Buy Now
Questions 7

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.

Buy Now
Questions 8

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 Step Into

you can

A. examine the object tree for a variable, expand it in the Variables view. If the Variables view is not visible

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

Buy Now
Questions 9

As an example. Our MutableLiveData object, named mLapseTime, is not connected to a Room database, etc. How can we change the value in mLapseTime?

A. mLapseTime.postValue("new String")

B. mLapseTime.setValue(1000l)

C. mLapseTime.changeValue(1000l)

Buy Now
Questions 10

Interface for a callback to be invoked when a shared preference is changed. Interface is named:

A. android.content.SyncStatusObserver

B. android.content.SharedPreferences.Editor

C. android.content.SharedPreferences.OnSharedPreferenceChangeListener

D. android.content.SharedPreferences

Buy Now
Questions 11

What statements about InputStreamReader (java.io.InputStreamReader) are correct? (Choose two.)

A. An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

B. An InputStreamReader is a bridge from character streams to byte streams: It reads characters using a specified charset and encodes them into bytes. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

C. Each invocation of one of an InputStreamReader's read() methods may cause one or more bytes to be read from the underlying byte-input stream. To enable the efficient conversion of bytes to characters, more bytes may be read ahead from the underlying stream than are necessary to satisfy the current read operation.

D. No any invocation of one of an InputStreamReader's read() methods can cause some bytes to be read from the underlying byte-input stream.

Buy Now
Questions 12

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:

A. Activity/Fragment

B. ViewModel

C. Repository

D. Room database

Buy Now
Questions 13

As an example. In an Activity we have our TimerViewModel object (extended ViewModel), named mTimerViewModel. mTimerViewModel.getTimer() 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.getTimer().getValue().toString().observe(new Observer() {@Overridepublic void onChanged(Long aLong) {

callAnyChangeUIMethodHere(aLong)

}

});

B. mTimerViewModel.getTimer().observe(this, new Observer() {@Overridepublic void onChanged(Long aLong) {

callAnyChangeUIMethodHere(aLong)

}

});

C. mTimerViewModel.observe(new Observer() {@Overridepublic void onChanged(Long aLong) {

callAnyChangeUIMethodHere(aLong)

}

});

Buy Now
Exam Name: Associate Android Developer (Kotlin and Java)
Last Update: Jan 04, 2025
Questions: 128
10%OFF Coupon Code: SAVE10

PDF (Q&A)

$49.99

VCE

$55.99

PDF + VCE

$65.99