Labour Day 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)

Question # 4

Choose the most correct statement.

A.

Android is a closed source, Linux-based software stack created for a wide array of devices and form factors.

B.

Android is a closed source, Windows-based software stack created for a wide array of devices and form factors.

C.

Android is an open source, Linux-based software stack created for a wide array of devices and form factors.

D.

Android is an open source software stack created for a highly limited array of devices and form factors.

Full Access
Question # 5

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

Full Access
Question # 6

The easiest way of adding menu items (to specify the options menu for an activity) is inflating an XML file into the Menu via MenuInflater. With menu_main.xml we can do it in this way:

A.

override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_main, menu)

return true

}

B.

override fun onOptionsItemSelected(item: MenuItem): Boolean {

menuInflater.inflate(R.menu.menu_main, menu) return super.onOptionsItemSelected(item)

}

C.

override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.menu.menu_main)

}

Full Access
Question # 7

By default, the notification's text content is truncated to fit one line. If you want your notification to be longer, for example, to create a larger text area, you can do it in this way:

A.

NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)

.setContentText("Much longer text that cannot fit one line...")

.setStyle(new NotificationCompat.BigTextStyle()

.bigText("Much longer text that cannot fit one line..."))

...

B.

NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)

.setContentText("Much longer text that cannot fit one line...")

.setLongText("Much longer text that cannot fit one line..."))

...

C.

NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)

.setContentText("Much longer text that cannot fit one line...")

.setTheme(android.R.style.Theme_LongText);

...

Full Access
Question # 8

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?

A.

NotificationChannel.setPriority()

B.

NotificationChannel.setImportance()

C.

NotificationCompat.Builder.setImportance()

Full Access
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
Question # 17

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.)

A.

REPLACE (existing work with the new work. This option cancels the existing work)

B.

KEEP (existing work and ignore the new work)

C.

APPEND (the new work to the end of the existing work. This policy will cause your new work to be chained to the existing work, running after the existing work finishes)

D.

APPEND_OR_REPLACE (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still runs)

E.

APPEND_OR_KEEP (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still not runs)

F.

APPEND_AND_RUN (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is PAUSED, the new work still runs)

G.

DESTROY (if any work exists, the new work will be ignored)

Full Access
Question # 18

About queries in DAO classes. Room verifies the return value of the query such that if the name of the field in the returned object doesn't match the corresponding column names in the query response, Room alerts you in one of the following two ways: (Choose two.)

A.

It gives a warning if no field names match.

B.

It gives a warning if only some field names match.

C.

It gives an error if no field names match.

D.

It gives an error if only some field names match.

Full Access
Question # 19

SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. To mark in the editor that a preference value should be removed, which will be done in the actual preferences once commit() or apply() is called, what method in SharedPreferences.Editor should we use?

A.

delete(String key)

B.

clear()

C.

remove(String key)

D.

removeAll()

Full Access