New Year Special Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: scxmas70

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

Go to page:
Question # 9

An overridden method onCreateOptionsMenu in an Activity returns boolean value. What does this value mean?

A.

You must return true for the menu to be displayed; if you return false it will not be shown.

B.

You must return false for the menu to be displayed; if you return true it will not be shown.

C.

You can return any value: the menu will be displayed anyway.

Full Access
Question # 10

We have a custom view that extends android.widget.ProgressBar. Our progress bar is not touchable, focusable, etc.: it just shows progress. Style for our custom progress bar extends

“Widget.AppCompat.ProgressBar.Horizontal”. An item, named “progressDrawable”, in our style, is a xml file . What we usually can see as a main single element in this xml file:

A.

A State List ( element )

B.

A Layer List ( element) with items android:id="@+id/progress" and android:id="@+id/ background" inside it.

C.

An element with android:id="@+id/progress" identifier

Full Access
Question # 11

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.

A.

@Override

public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {

boolean completed = super.dispatchPopulateAccessibilityEvent(event);

CharSequence text = getText();

if (!TextUtils.isEmpty(text)) {

event.getText().add(text);

return true;

}

return completed;

}

B.

@Override

public boolean onKeyUp (int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {

currentValue--;

sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED);

return true;

}

...

}

C.

@Override

public boolean onKeyUp (int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_ENTER) {

currentValue--;

sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED);

return true;

}

...

}

Full Access
Question # 12

What method should we use with Notification.Builder to supply a PendingIntent to be sent when the notification is clicked?

A.

setContentInfo

B.

setContentIntent

C.

setDeleteIntent

Full Access
Question # 13

For example, we have a BufferedReader reader, associated with the json file through

InputStreamReader. To get a file data we can do this:

A.

var line: String? try {

while (reader.readLine().also { line = it } != null) { builder.append(line)

}

val json = JSONObject(builder.toString())

return json

} catch (exception: IOException) {

exception.printStackTrace()

} catch (exception: JSONException) {

exception.printStackTrace()

}

B.

var line: JSONObject ? try {

while (reader.readJSONObject ().also { line = it } != null) {

builder.append(line)

}

val json = JSONObject(builder.toString())

return json

} catch (exception: IOException) {

exception.printStackTrace()

} catch (exception: JSONException) {

exception.printStackTrace()

}

C.

var line: String? try {

while (reader.readLine().also { line = it } != null) { builder.append(line)

}

val json = JSONObject(builder.toString())

return json

} catch (exception: RuntimeException) {

exception.printStackTrace()

} catch (exception: ArrayIndexOutOfBoundsException) {

exception.printStackTrace()

}

Full Access
Question # 14

Select correct demonstration of WorkRequest cancellation.

A.

workManager.enqueue(OneTimeWorkRequest.Builder(FooWorker::class.java).build())

B.

val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request)

val status = workManager.getWorkInfoByIdLiveData(request.id) status.observe(...)

C.

val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWorkById(request.id)

D.

val request1: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build()

val request2: WorkRequest = OneTimeWorkRequest.Builder (BarWorker::class.java).build()

val request3: WorkRequest = OneTimeWorkRequest.Builder (BazWorker::class.java).build()

workManager.beginWith(request1, request2).then(request3).enqueue()

E.

val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWork(request)

Full Access
Question # 15

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.

Full Access
Question # 16

About running a debuggable build variant. Usually, you can just select the default "debug" variant that's included in every Android Studio project (even though it's not visible in the build.gradle file). But if you define new build types that should be debuggable, you must add ‘debuggable true’ to the build type. Is that mostly true?

A.

Yes.

B.

No, if you define new build types that should be debuggable, you must add ‘debuggable false’

C.

No, the debug variant should be visible in the build.gradle file anyway.

Full Access
Go to page: