Black Friday Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: clap70

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

Questions 4

Select correct statements about Hardware Abstraction Layer (HAL). (Choose two.)

Options:

A.

The HAL provides standard interfaces that expose device hardware capabilities to the higher-level Java API framework.

B.

The HAL function both as apps for users and to provide key capabilities that developers can access from their own app. For example, if your app would like to deliver an SMS message, you don't need to build that functionality yourself – you can instead invoke whichever SMS app is already installed to deliver a message to the recipient you specify

C.

The HAL consists of multiple library modules, each of which implements an interface for a specific type of hardware component, such as the camera or bluetooth module. When a framework API makes a call to access device hardware, the Android system loads the library module for that hardware component.

D.

Using a HAL, not using a Linux kernel, allows Android to take advantage of key security features and allows device manufacturers to develop hardware drivers for a well-known kernel.

Buy Now
Questions 5

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

Options:

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.

Buy Now
Questions 6

In our TeaViewModel class, that extends ViewModel, we have such method:

public LiveData getTea() { return mTea;

}

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?

Options:

A.

private void displayTea()

B.

private void displayTea(Tea tea)

C.

private void displayTea(LiveData)

D.

private void displayTea(LiveData)

Buy Now
Questions 7

LiveData.postValue() and LiveData.setValue() methods have some differences. So if you have a following code executed in the main thread:

liveData.postValue("a"); liveData.setValue("b");

What will be the correct statement?

Options:

A.

The value "b" would be set at first and later the main thread would override it with the value "a".

B.

The value "a" would be set at first and later the main thread would override it with the value "b".

C.

The value "b" would be set at first and would not be overridden with the value "a".

D.

The value "a" would be set at first and would not be overridden with the value "b".

Buy Now
Questions 8

“workManager” is an instance of WorkManager. Select correct demonstration of WorkRequest cancellation:

Options:

A.

workManager.enqueue(new OneTimeWorkRequest.Builder(FooWorker.class).build());

B.

WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build(); workManager.enqueue(request);

LiveData status = workManager.getWorkInfoByIdLiveData(request.getId ());

status.observe(...);

C.

WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build(); workManager.enqueue(request);

workManager.cancelWorkById(request.getId());

D.

WorkRequest request1 = new OneTimeWorkRequest.Builder(FooWorker.class).build();

WorkRequest request2 = new OneTimeWorkRequest.Builder(BarWorker.class).build

();

WorkRequest request3 = new OneTimeWorkRequest.Builder(BazWorker.class).build

();

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

E.

WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build(); workManager.enqueue(request);

workManager.cancelWork(request);

Buy Now
Questions 9

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.

Options:

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;

}

...

}

Buy Now
Questions 10

Custom views and directional controller clicks. On most devices, clicking a view using a directional controller sends (to the view currently in focus) a KeyEvent with:

Options:

A.

KEYCODE_DPAD_CENTER

B.

KEYCODE_BUTTON_START

C.

KEYCODE_CALL

D.

KEYCODE_BUTTON_SELECT

Buy Now
Questions 11

Once your test has obtained a UiObject object, you can call the methods in the UiObject class to perform user interactions on the UI component represented by that object. You can specify such actions as: (Choose four.)

Options:

A.

click() : Clicks the center of the visible bounds of the UI element.

B.

touch() : Touch the center of the visible bounds of the UI element.

C.

dragTo() : Drags this object to arbitrary coordinates.

D.

moveTo() : Move this object to arbitrary coordinates.

E.

setText() : Sets the text in an editable field, after clearing the field's content. Conversely, the

clearTextField() method clears the existing text in an editable field.

F.

swipeUp() : Performs the swipe up action on the UiObject. Similarly, the swipeDown(), swipeLeft(), and swipeRight() methods perform corresponding actions.

Buy Now
Questions 12

@Query is the main annotation used in DAO classes. It allows you to perform read/write operations on a database. Each @Query method is verified at compile time, so what happens if there is a problem with the query?

Options:

A.

a runtime error occurs instead of a compilation failure.

B.

a compilation error occurs instead of a runtime failure.

C.

both compilation error and runtime failure occurs.

Buy Now
Questions 13

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:

Options:

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)

}

Buy Now
Questions 14

Filter logcat messages. If in the filter menu, a filter option “Show only selected application”? means:

Options:

A.

Display the messages produced by the app code only (the default). Logcat filters the log messages using the PID of the active app.

B.

Apply no filters. Logcat displays all log messages from the device, regardless of which process you selected.

C.

Create or modify a custom filter. For example, you could create a filter to view log messages from two apps at the same time.

Buy Now
Questions 15

SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. All changes you make in an editor are batched, and not copied back to the original SharedPreferences until you call:

Options:

A.

commit()

B.

apply()

C.

commit() or apply()

Buy Now
Questions 16

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

Options:

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 17

In a class PreferenceFragmentCompat. What method is called during onCreate(Bundle) to supply the preferences for this fragment. And where subclasses are expected to call setPreferenceScreen (PreferenceScreen) either directly or via helper methods such as addPreferencesFromResource (int)?

Options:

A.

onCreateLayoutManager

B.

onCreatePreferences

C.

onCreateRecyclerView

D.

onCreateView

Buy Now
Questions 18

For example, we have a file in our raw folder app/src/main/res/raw/sample_teas.json. To get an

InputStream for reading it, from out Context context, we can do this:

Options:

A.

val input = context!!.openRawResource(R.raw.sample_teas)

B.

val input = context!!.getRawResource(R.raw.sample_teas)

C.

val input = context!!.resources.openRawResource(R.raw.sample_teas)

Buy Now
Questions 19

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 :

Options:

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
Exam Name: Google Developers Certification - Associate Android Developer (Kotlin and Java Exam)
Last Update: Nov 22, 2024
Questions: 128
Associate-Android-Developer pdf

Associate-Android-Developer PDF

$25.5  $84.99
Associate-Android-Developer Engine

Associate-Android-Developer Testing Engine

$30  $99.99
Associate-Android-Developer PDF + Engine

Associate-Android-Developer PDF + Testing Engine

$40.5  $134.99