Weekend Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmaspas7

Easiest Solution 2 Pass Your Certification Exams

Associate-Android-Developer Google Developers Certification - Associate Android Developer (Kotlin and Java Exam) Free Practice Exam Questions (2025 Updated)

Prepare effectively for your Google Associate-Android-Developer Google Developers Certification - Associate Android Developer (Kotlin and Java Exam) certification with our extensive collection of free, high-quality practice questions. Each question is designed to mirror the actual exam format and objectives, complete with comprehensive answers and detailed explanations. Our materials are regularly updated for 2025, ensuring you have the most current resources to build confidence and succeed on your first attempt.

The diagram below shows a basic form of the recommended architecture for apps that use Architecture Components. The architecture consists of a UI controller, a ViewModel that serves LiveData, a Repository, and a Room database. Drag modules to correct places.

The Log class allows you to create log messages that appear in logcat. Generally, you could use the following log methods: (Choose five.)

A.

Log.e(String, String) (error)

B.

Log.a(String, String) (all outputs)

C.

Log.w(String, String) (warning)

D.

Log.i(String, String) (information)

E.

Log.q(String, String) (QUESTION NO:s)

F.

Log.d(String, String) (debug)

G.

Log.v(String, String) (verbose)

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

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

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

}

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

What statements about InputStreamReader (java.io.InputStreamReader) are correct? (Choose two.)

A.

An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

B.

An InputStreamReader is a bridge from character streams to byte streams: It reads characters using a specified charset and encodes them into bytes. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

C.

Each invocation of one of an InputStreamReader's read() methods may cause one or more bytes to be read from the underlying byte-input stream. To enable the efficient conversion of bytes to characters, more bytes may be read ahead from the underlying stream than are necessary to satisfy the current read operation.

D.

No any invocation of one of an InputStreamReader's read() methods can cause some bytes to be read from the underlying byte-input stream.

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

The Testing Pyramid, shown in the Figure, illustrates how your app should include the three categories of tests: small, medium, and large. Medium tests are integration 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.

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

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

A.

@Entity

B.

@Query

C.

@RawQuery

D.

@DAO

E.

@WorkerThread

F.

@Database

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.

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?

A.

@RunWith

B.

@LargeTest

C.

@Rule

D.

@Test

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

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)

}

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.

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 do this:

A.

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

B.

val input = context!!.assets.open("sample_teas.json")

C.

val input = context!!.resources.assets.open("sample_teas.json")

By adding a RoomDatabase.Callback to the room database builder RoomDatabase.Builder (method

addCallback(RoomDatabase.Callback callback)), we can: (Choose two.)

A.

set the database factory

B.

handle database first time creation

C.

handle database opening

D.

disable the main thread query check for Room

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

}

...

}

}

Filter logcat messages. If in the filter menu, a filter option “Show only selected application”? 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.

The Layout Inspector in Android Studio allows you to compare your app layout with design mockups, display a magnified or 3D view of your app, and examine details of its layout at runtime. When this is especially useful?

A.

when your layout is built entirely in XML rather than runtime and the layout is behaving expectedly.

B.

when your layout is built at runtime rather than entirely in XML and the layout is behaving unexpectedly.

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

Copyright © 2014-2025 Solution2Pass. All Rights Reserved