Google ASSOCIATE-ANDROID-DEVELOPER Online Practice
Questions and Exam Preparation
ASSOCIATE-ANDROID-DEVELOPER Exam Details
Exam Code
:ASSOCIATE-ANDROID-DEVELOPER
Exam Name
:Associate Android Developer (Kotlin and Java)
Certification
:Google Certifications
Vendor
:Google
Total Questions
:128 Q&As
Last Updated
:Jul 14, 2026
Google ASSOCIATE-ANDROID-DEVELOPER Online Questions &
Answers
Question 31:
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)}});
B. mTimerViewModel.getTimer().observe(this, new Observer() {@Overridepublic void onChanged(Long aLong) {callAnyChangeUIMethodHere(aLong)}});
Question 32:
In our TeaViewModel class, that extends ViewModel, we have such prorerty: val tea: LiveData
An observer in our Activity (type of mViewModel variable in example is TeaViewModel) is set in this way:
What will be a correct displayTea method definition?
A. private fun displayTea() B. private fun displayTea(tea: Tea?) C. private fun displayTea(tea: LiveData?) D. private fun displayTea(tea: LiveData?)
B. private fun displayTea(tea: Tea?)
Question 33:
"workManager" is an instance of WorkManager. Select correct demonstration of WorkRequest cancellation:
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);
C. WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build();workManager.enqueue(request);workManager.cancelWorkById(request.getId());
Question 34:
When using an EditTexts or editable TextViews, or other editable View. What attribute to use to provide a content label for that View?
A. android:contentDescription B. android:hint C. android:labelFor
B. android:hint
Question 35:
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?
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".
B. The value "a" would be set at first and later the main thread would override it with the value "b".
Question 36:
In application theme style, flag windowActionBar () indicates:
A. whether the given application component is available to other applications. B. whether action modes should overlay window content when there is not reserved space for their UI (such as an Action Bar). C. whether this window's Action Bar should overlay application content. D. whether this window should have an Action Bar in place of the usual title bar.
D. whether this window should have an Action Bar in place of the usual title bar.
Question 37:
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()}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()}
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()}
Question 38:
In application theme style, flag windowNoTitle () indicates:
A. whether this window should have an Action Bar in place of the usual title bar. B. whether there should be no title on this window. C. that this window should not be displayed at all. D. whether this is a floating window. E. whether this Window is responsible for drawing the background for the system bars.
B. whether there should be no title on this window.
Question 39:
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.
What happens when you create a DAO method and annotate it with @Insert?
Example:
@Dao
public interface MyDao {@Insert(onConflict = OnConflictStrategy.REPLACE)public void insertUsers(User... users);
}
A. Room generates an implementation that inserts all parameters into the database in a single transaction. B. Room modifies a set of entities, given as parameters, in the database. It uses a query that matches against the primary key of each entity. C. Room removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.
A. Room generates an implementation that inserts all parameters into the database in a single transaction.
Nowadays, the certification exams become more and more important and required by more and more
enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare
for the exam in a short time with less efforts? How to get a ideal result and how to find the
most reliable resources? Here on Vcedump.com, you will find all the answers.
Vcedump.com provide not only Google exam questions,
answers and explanations but also complete assistance on your exam preparation and certification
application. If you are confused on your ASSOCIATE-ANDROID-DEVELOPER exam preparations
and Google certification application, do not hesitate to visit our
Vcedump.com to find your solutions here.