Summer Special - 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: c4sdisc65

Associate-Android-Developer PDF

$38.5

$109.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

Associate-Android-Developer PDF + Testing Engine

$61.6

$175.99

3 Months Free Update

  • Exam Name: Google Developers Certification - Associate Android Developer (Kotlin and Java Exam)
  • Last Update: Sep 12, 2025
  • Questions and Answers: 128
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

Associate-Android-Developer Engine

$46.2

$131.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included

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

Question # 6

Which build options in the Build menu to choose to delete all intermediate/cached build files.

A.

Make Module

B.

Generate Signed Bundle / APK

C.

Rebuild Project

D.

Clean Project

E.

Make Project

Full Access
Question # 7

A content label sometimes depends on information only available at runtime, or the meaning of a View might change over time. For example, a Play button might change to a Pause button during music playback. In these cases, to update the content label at the appropriate time, we can use:

A.

View#setContentDescription(int contentDescriptionResId)

B.

View#setContentLabel(int contentDescriptionResId)

C.

View#setContentDescription(CharSequence contentDescription)

D.

View#setContentLabel(CharSequence contentDescription)

Full Access
Question # 8

Custom views and directional controller clicks. In general, you should send an AccessibilityEvent whenever the content of your custom view changes. For example, if a text value was changed in your custom view, you should emit an event of this type:

A.

TYPE_WINDOWS_CHANGED

B.

TYPE_VIEW_CONTEXT_CLICKED

C.

TYPE_WINDOWS_CHANGED

D.

TYPE_VIEW_TEXT_CHANGED

Full Access
Question # 9

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

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

A.

InputStream input = context.getResources().openRawResource(R.raw.sample_teas);

B.

InputStream input = context.getAssets().open("sample_teas.json");

C.

InputStream input = context.getResources().getAssets().open ("sample_teas.json");

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

A.

KEYCODE_DPAD_CENTER

B.

KEYCODE_BUTTON_START

C.

KEYCODE_CALL

D.

KEYCODE_BUTTON_SELECT

Full Access
Question # 11

Working with Custom View. Once you define the custom attributes, you can use them in layout XML files just like built-in attributes. The only difference is that your custom attributes belong to a different namespace. Instead of belonging to the http://schemas.android.com/apk/res/android namespace, they belong to:

A.

http://schemas.android.com/apk/res/[your package name]

B.

http://schemas.android.com/apk/[your package name]

C.

http://schemas.android.com/[your package name]

Full Access
Question # 12

“Set the activity content to an explicit view. This view is placed directly into the activity's view hierarchy. It can itself be a complex view hierarchy.” This can be done by calling method:

A.

findViewById

B.

setContentView

C.

setActionBar

D.

setContentTransitionManager

E.

setTheme

Full Access
Question # 13

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 # 14

If you want to access a specific UI component in an app, use the UiSelector class. This class represents a query for specific elements in the currently displayed UI. What is correct about it? (Choose two.)

A.

If more than one matching element is found, the first matching element in the layout hierarchy is returned as the target UiObject.

B.

If no matching UI element is found, an IOException is thrown.

C.

If more than one matching element is found, the last matching element in the layout hierarchy is returned as the target UiObject.

D.

If no matching UI element is found, a UiAutomatorObjectNotFoundException is thrown.

Full Access
Question # 15

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 # 16

What happens when you create a DAO method and annotate it with @Insert?

Example:

@Dao

interface MyDao {

@Insert(onConflict = OnConflictStrategy.REPLACE)

fun insertUsers(vararg users: User)

}

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.

Full Access
Question # 17

With our Context we can get SharedPreferences with a method, named: getSharedPreferences (String name, int mode). What value can we transfer in a “mode”parameter?

A.

MODE_PRIVATE or MODE_PUBLIC

B.

combination of MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE

C.

Value is either 0 or a combination of MODE_PRIVATE, MODE_WORLD_READABLE, D.

MODE_WORLD_WRITEABLE, and MODE_MULTI_PROCESS

Full Access
Question # 18

As an example. Our MutableLiveData object, named mLapseTime, is not connected to a Room database, etc. How can we change the value in mLapseTime?

A.

mLapseTime.postValue(“new String”)

B.

mLapseTime.setValue(1000l)

C.

mLapseTime.changeValue(1000l)

Full Access
Question # 19

Filter logcat messages. If in the filter menu, a filter option “Edit Filter Configuration”? means:

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.

Full Access
Question # 20

Associate-Android-Developer question answer

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 :

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 # 21

With recommended app architecture. Fill the following diagram, which shows how all the modules usually should interact with one another after designing the app (drag modules to correct places).

Associate-Android-Developer question answer

Full Access
Question # 22

In a class PreferenceFragmentCompat. As a convenience, this fragment implements a click listener for any preference in the current hierarchy. So, in what overridden method we can handle that a preference in the tree rooted at this PreferenceScreen has been clicked?

A.

onCreateLayoutManager

B.

onCreatePreferences

C.

onCreateRecyclerView

D.

onPreferenceTreeClick

Full Access
Question # 23

A class that you create for managing multiple data sources. In addition to a Room database, this class could manage remote data sources such as a web server. It is about:

A.

Activity/Fragment

B.

ViewModel

C.

Repository

D.

Room database

Full Access
Question # 24

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

Full Access
Question # 25

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 # 26

Interface for a callback to be invoked when a shared preference is changed. Interface is named:

A.

android.content.SyncStatusObserver

B.

android.content.SharedPreferences.Editor

C.

android.content.SharedPreferences.OnSharedPreferenceChangeListener

D.

android.content.SharedPreferences

Full Access
Question # 27

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:

mViewModel!!.tea.observe(this, Observer { tea: Tea? -> displayTea(tea) })

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

Full Access
Question # 28

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

android:title="@string/pref_notification_title" android:summary="@string/pref_notification_summary" android:defaultValue="@bool/pref_notification_default_value" app:iconSpaceReserved="false"/>

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

A.

val isNotificationOn = PreferenceManager.getDefaultSharedPreferences (context).getBoolean(

context!!.getString(R.string.pref_notification_key), context!!.resources.getBoolean(R.bool.pref_notification_default_value)

)

B.

val isNotificationOn = PreferenceManager.getSharedPreferences (context).getBoolean(

context!!.getString(R.string.pref_notification_default_value), context!!.getString(R.string.pref_notification_key),

)

C.

val isNotificationOn = PreferenceManager.getSharedPreferences (context).getBoolean(

context!!.resources.getBoolean(R.bool.pref_notification_default_value), context!!.getString(R.string.pref_notification_key)

)

Full Access
Question # 29

Each time your test invokes onView(), Espresso waits to perform the corresponding UI action or assertion until the following synchronization conditions are met: (Choose three.)

A.

The message queue is empty.

B.

The message queue is not empty.

C.

There are some instances of AsyncTask currently executing a task.

D.

There are no instances of AsyncTask currently executing a task.

E.

Some developer-defined idling resources are not idle.

F.

All developer-defined idling res

Full Access
Question # 30

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.

var builder = NotificationCompat.Builder(this, CHANNEL_ID)

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

.setStyle(NotificationCompat.BigTextStyle()

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

...

B.

var builder = NotificationCompat.Builder(this, CHANNEL_ID)

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

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

...

C.

var builder = NotificationCompat.Builder(this, CHANNEL_ID)

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

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

...

Full Access
Question # 31

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 fun dispatchPopulateAccessibilityEvent(event: AccessibilityEvent): Boolean {

return super.dispatchPopulateAccessibilityEvent(event).let { completed -> if (text?.isNotEmpty() == true) {

event.text.add(text) true

} else {

completed

}

}

}

B.

override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { return when(keyCode) {

KeyEvent.KEYCODE_DPAD_LEFT -> {

currentValue--

sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED)

true

}

...

}

}

C.

override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { return when(keyCode) {

KeyEvent.KEYCODE_ENTER -> {

currentValue--

sendAccessibilityEvent

(AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED)

true

}

...

}

}

Full Access
Question # 32

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 # 33

Working with Custom View. To define custom attributes, we can add resources to our project. It is customary to put these resources into a file:

A.

res/layout/attrs.xml

B.

res/values/attrs.xml

C.

res/raw/attrs.xml

D.

res/xml/attrs.xml

Full Access
Question # 34

Move the major components of the Android platform to correct places in diagram.

Associate-Android-Developer question answer

Full Access
Question # 35

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:

A.

InputStream input = context.openRawResource(R.raw.sample_teas);

B.

InputStream input = context.getRawResource(R.raw.sample_teas);

C.

InputStream input = context.getResources().openRawResource(R.raw.sample_teas);

Full Access
Question # 36

If constant LENGTH_INDEFINITE is used as a parameter for the setDuration method in Snackbar, what will happen?

A.

The Snackbar will be displayed for a short period of time.

B.

The Snackbar will be displayed for a long period of time.

C.

The Snackbar will be displayed for a very long period of time.

D.

The Snackbar will be displayed from the time that is shown until either it is dismissed, or another Snackbar is shown.

E.

The constant LENGTH_INDEFINITE is impossible parameter for the setDuration method in Snackbar

Full Access
Question # 37

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 # 38

What public methods are there in android.widget.Toast.Callback? (Choose two.)

A.

onDismissed()

B.

onToastHidden()

C.

onShown()

D.

onToastShown()

E.

onToastCancelled()

Full Access