Spring Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: pass65

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

Questions 4

The following code snippet shows an example of an Espresso test:

Options:

A.

@Rule

fun greeterSaysHello() {

onView(withId(R.id.name_field)).do(typeText( " Steve " ))

onView(withId(R.id.greet_button)).do(click())

onView(withText( " Hello Steve! " )).check(matches(isDisplayed()))

}

B.

@Test

fun greeterSaysHello() {

onView(withId(R.id.name_field)).perform(typeText( " Steve " ))

onView(withId(R.id.greet_button)).perform(click())

onView(withText( " Hello Steve! " )).check(matches(isDisplayed()))

}

C.

@Test

fun greeterSaysHello() {

onView(withId(R.id.name_field)).do(typeText( " Steve " ))

onView(withId(R.id.greet_button)).do(click())

onView(withText( " Hello Steve! " )).compare(matches(isDisplayed()))

}

Buy Now
Questions 5

In a class extended PreferenceFragmentCompat. What method is used to inflate the given XML resource and add the preference hierarchy to the current preference hierarchy?

Options:

A.

findPreference

B.

getPreferenceManager

C.

addPreferencesFromResource

D.

setPreferenceScreen

Buy Now
Questions 6

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 6

Options:

Buy Now
Questions 7

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

Options:

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

Buy Now
Questions 8

To run a debuggable build variant you must use a build variant that includes

Options:

A.

minifyEnabled false in the build configuration

B.

debuggable true or debuggable false in the build configuration

C.

debuggable true in the build configuration

Buy Now
Questions 9

Select 3 major components of the Room. (Choose three.)

Options:

A.

@Entity

B.

@Query

C.

@RawQuery

D.

@DAO

E.

@WorkerThread

F.

@Database

Buy Now
Questions 10

Associate-Android-Developer Question 10

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
Questions 11

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

Options:

A.

android.content.SyncStatusObserver

B.

android.content.SharedPreferences.Editor

C.

android.content.SharedPreferences.OnSharedPreferenceChangeListener

D.

android.content.SharedPreferences

Buy Now
Questions 12

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?

Options:

A.

onCreateLayoutManager

B.

onCreatePreferences

C.

onCreateRecyclerView

D.

onPreferenceTreeClick

Buy Now
Questions 13

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?

Options:

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.

Buy Now
Questions 14

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 15

What do you want from Room when you create a DAO method and annotate it with @Update?

Example:

@Dao

interface MyDao {

@Update

fun updateUsers(vararg users: User)

}

Options:

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.

Buy Now
Questions 16

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 17

Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following code example shows how your test might specify a search to find the first ListView in the currently displayed UI, then search within that ListView to find a UI element with the text property Apps.

What is the correct sample?

Options:

A.

val appItem: UiObject = device.findObject( UiSelector().className(ListView.class)

.instance(1)

.childSelector(

UiSelector().text( " Apps " )

)

)

B.

val appItem: UiObject = device.findObject( UiSelector().className( " android.widget.ListView " )

.instance(0)

.childSelector(

UiSelector().text( " Apps " )

)

)

C.

val appItem: UiObject = device.findObject( UiSelector().className( " android.widget.ListView " )

.instance(

UiSelector().text( " Apps " )

)

)

Buy Now
Questions 18

To create a basic JUnit 4 test class, create a class that contains one or more test methods. A test method begins with the specific annotation and contains the code to exercise and verify a single functionality in the component that you want to test. What is the annotation?

Options:

A.

@RunWith

B.

@LargeTest

C.

@Rule

D.

@Test

Buy Now
Questions 19

Associate-Android-Developer Question 19

What is illustrated in the picture?

Options:

A.

Logcat window with filter settings

B.

Debugging native code using LLDB

C.

The Variables and Watches panes in the Debugger window

D.

The Breakpoints window lists all the current breakpoints and includes behavior settings for each

E.

Adding a watchpoint to a variable in memory

Buy Now
Questions 20

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

< ListPreference android:id= " @+id/order_by " android:key= " @string/pref_sort_key "

android:title= " @string/pref_sort_title " android:summary= " @string/pref_sort_summary " android:dialogTitle= " @string/pref_sort_dialog_title " android:entries= " @array/sort_oder " android:entryValues= " @array/sort_oder_value " android:defaultValue= " @string/pref_default_sort_value " app:iconSpaceReserved= " false " / >

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

Options:

A.

String sortBy = PreferenceManager.getDefaultSharedPreferences(getContext ()).getString(

getContext().getString(R.string.pref_sort_key), getContext().getResources().getBoolean(R.bool.pref_default_sort_value)

);

B.

String sortBy = PreferenceManager.getSharedPreferences(getContext()).getString( getContext().getString(R.string.pref_default_sort_value), getContext().getString(R.string.pref_sort_key)

);

C.

boolean sortBy = PreferenceManager.getSharedPreferences(getContext()).getBoolean (

getContext().getResources().getBoolean(R.bool.pref_default_sort_value), getContext().getString(R.string.pref_sort_key)

);

D.

String sortBy = PreferenceManager.getDefaultSharedPreferences(getContext ()).getString(

getContext().getString(R.string.pref_sort_key), getContext().getString(R.string.pref_default_sort_value)

)

Buy Now
Questions 21

“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 < WorkInfo > 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 22

Content labels. What attribute to use to indicate that a View should act as a content label for another View?

Options:

A.

android:contentDescription

B.

android:hint

C.

android:labelFor

Buy Now
Questions 23

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 24

An example. In our ViewModelFactory (that implements ViewModelProvider.Factory) we have an instance of our Repository, named mRepository. Our ViewModel has such constructor:

public MyViewModel(MyRepository myRepository)...

Next, in our ViewModelFactory create ViewModel method (overriden) looks like this:

@NonNull

@Override

public < T extends ViewModel > T create(@NonNull Class < T > modelClass) { try {

//MISSED RETURN VALUE HERE

} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {

throw new RuntimeException( " Cannot create an instance of " + modelClass, e);

}

}

What should we write instead of “//MISSED RETURN VALUE HERE”?

Options:

A.

return modelClass.getConstructor()

.newInstance(mRepository);

B.

return modelClass.getConstructor(MyRepository.class)

.newInstance();

C.

return modelClass.getConstructor(MyRepository.class)

.newInstance(mRepository);

Buy Now
Questions 25

Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following code example shows how your test might specify a search to find the first ListView in the currently displayed UI, then search within that ListView to find a UI element with the text property Apps.

What is the correct sample?

Options:

A.

UiObject appItem = device.findObject(new UiSelector()

.className(ListView.class)

.instance(1)

.childSelector(new UiSelector()

.text( " Apps " )));

B.

UiObject appItem = device.findObject(new UiSelector()

.className( " android.widget.ListView " )

.instance(0)

.childSelector(new UiSelector()

.text( " Apps " )));

C.

UiObject appItem = device.findObject(new UiSelector()

.className( " android.widget.ListView " )

.instance(new UiSelector()

.text( " Apps " )));

Buy Now
Questions 26

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

Options:

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)

Buy Now
Questions 27

To handle an options menu item click in an activity, we usually should override method named:

Options:

A.

onKey

B.

onClick

C.

onOptionsItemSelected

Buy Now
Questions 28

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

Associate-Android-Developer Question 28

Options:

Buy Now
Questions 29

To build a debug APK, you can open a command line and navigate to the root of your project directory. To initiate a debug build, invoke the assembleDebug task:

gradlew assembleDebug

This creates an APK named [module_name]-debug.apk in [project_name] /[module_name]/build/outputs/apk/

Select correct statements about generated file. (Choose all that apply.)

Options:

A.

The file is already signed with the debug key

B.

The file is already aligned with zipalign

C.

You can immediately install this file on a device.

Buy Now
Questions 30

In a common Paging Library architecture scheme, move instances to the correct positions.

Associate-Android-Developer Question 30

Options:

Buy Now
Questions 31

In application theme style, flag windowNoTitle ( < item name= " windowNoTitle " > ) indicates:

Options:

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.

Buy Now
Questions 32

Choose the most correct statement.

Options:

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

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

< SwitchPreference android:id= " @+id/notification " android:key= " @string/pref_notification_key "

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:

Options:

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
Questions 34

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 35

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 36

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

Options:

A.

Make Module

B.

Generate Signed Bundle / APK

C.

Rebuild Project

D.

Clean Project

E.

Make Project

Buy Now
Questions 37

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:

Options:

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 " );

Buy Now
Questions 38

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?

Options:

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
Exam Name: Google Developers Certification - Associate Android Developer (Kotlin and Java Exam)
Last Update: Apr 30, 2026
Questions: 128

PDF + Testing Engine

$63.52  $181.49

Testing Engine

$50.57  $144.49
buy now Associate-Android-Developer testing engine

PDF (Q&A)

$43.57  $124.49
buy now Associate-Android-Developer pdf