Exam2pass
0 items Sign In or Register
  • Home
  • IT Exams
  • Guarantee
  • FAQs
  • Reviews
  • Contact Us
  • Demo
Exam2pass > Google > Google Certifications > ASSOCIATE-ANDROID-DEVELOPER > ASSOCIATE-ANDROID-DEVELOPER Online Practice Questions and Answers

ASSOCIATE-ANDROID-DEVELOPER Online Practice Questions and Answers

Questions 4

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

}

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

Correct Answer: A

Reference: https://developer.android.com/guide/topics/ui/accessibility/custom-views

Questions 5

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!!) })

Buy Now

Correct Answer: B

Questions 6

With a room database. When performing queries, you'll often want your app's UI to update automatically when the data changes. Can you use a return value of type LiveData in your query method description to achieve this?

A. Yes

B. No

Buy Now

Correct Answer: A

Room generates all necessary code to update the LiveData when the database is updated.

Questions 7

By executing an allowMainThreadQueries() method to the room database builder RoomDatabase.Builder, we can:

A. set the database factory

B. handle database first time creation

C. handle database opening

D. disable the main thread query check for Room

Buy Now

Correct Answer: D

Questions 8

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. @Overridepublic boolean onKeyUp (int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {

currentValue--;

sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED);

return true;

}

...

}

C. @Overridepublic boolean onKeyUp (int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_ENTER) {

currentValue--;

sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED);

return true;

}

...

}

Buy Now

Correct Answer: B

Reference: https://developer.android.com/guide/topics/ui/accessibility/custom-views

Questions 9

In our TeaViewModelclass, that extends ViewModel, we have such method:

public LiveData getTea() {return mTea;}

An observer in our Activity (type of mViewModelvariable in example is TeaViewModel) is set in this way:

mViewModel.getTea().observe(this, this::displayTea);

What will be a correct displayTea method definition?

A. private void displayTea()

B. private void displayTea(Tea tea)

C. private void displayTea(LiveData)

D. private void displayTea(LiveData)

Buy Now

Correct Answer: B

Questions 10

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

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

A. boolean isNotificationOn = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean(getContext().getString(R.string.pref_notification_key),getContext().getResources().getBoolean(R.bool.pref_notification_default_value)

);

B. boolean isNotificationOn = PreferenceManager.getSharedPreferences(getContext()).getBoolean(getContext().getString(R.string.pref_notification_default_value),getContext().getString(R.string.pref_notification_key)

);

C. boolean isNotificationOn = PreferenceManager.getSharedPreferences(getContext()).getBoolean(getContext().getResources().getBoolean(R.bool.pref_notification_default_value),getContext().getString(R.string.pref_notification_key)

);

Buy Now

Correct Answer: A

Questions 11

Assume that an app includes a default set of graphics and two other sets of graphics, each optimized for a different device setup:

res/drawable/

Contains default graphics. res/drawable-small-land-stylus/

Contains graphics optimized for use with a device that expects input from a stylus and has a QVGA low-density screen in landscape orientation. res/drawable-ja/

Contains graphics optimized for use with Japanese.

What happens if the app runs on a device that is configured to use Japanese and, at the same time, the device happens to be one that expects input from a stylus and has a QVGA low-density screen in landscape orientation?

A. Android loads graphics from res/drawable/

B. Android loads graphics from res/drawable-small-land-stylus/

C. Android loads graphics from res/drawable-ja/

Buy Now

Correct Answer: C

Reference: https://developer.android.com/guide/topics/resources/localization

Questions 12

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.

Buy Now

Correct Answer: C

Reference: https://developer.android.com/guide/platform

Questions 13

Which statement is most true about layout_constraintLeft_toRightOf and layout_constraintStart_toEndOf constraints ?

A. layout_constraintLeft_toRightOf is equal to layout_constraintStart_toEndOf in any case

B. layout_constraintLeft_toRightOf is equal to layout_constraintStart_toEndOf in case if user choose a language that uses right-to-left (RTL) scripts, such as Arabic or Hebrew, for their UI locale

C. layout_constraintLeft_toRightOf is equal to layout_constraintStart_toEndOf in case if user choose a language that uses left-to-right (LTR) scripts, such as English or French, for their UI locale

D. layout_constraintLeft_toRightOf works with horizontal axes and layout_constraintStart_toEndOf works with vertical axes

Buy Now

Correct Answer: C

Reference: https://developer.android.com/training/basics/supporting-devices/languages

Exam Code: ASSOCIATE-ANDROID-DEVELOPER
Exam Name: Associate Android Developer (Kotlin and Java)
Last Update: May 29, 2026
Questions: 128

PDF (Q&A)

$45.99
ADD TO CART

VCE

$49.99
ADD TO CART

PDF + VCE

$59.99
ADD TO CART

Exam2Pass----The Most Reliable Exam Preparation Assistance

There are tens of thousands of certification exam dumps provided on the internet. And how to choose the most reliable one among them is the first problem one certification candidate should face. Exam2Pass provide a shot cut to pass the exam and get the certification. If you need help on any questions or any Exam2Pass exam PDF and VCE simulators, customer support team is ready to help at any time when required.

Home | Guarantee & Policy |  Privacy & Policy |  Terms & Conditions |  How to buy |  FAQs |  About Us |  Contact Us |  Demo |  Reviews

2026 Copyright @ exam2pass.com All trademarks are the property of their respective vendors. We are not associated with any of them.