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

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

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

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

SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. To mark in the editor that a preference value should be removed, which will be done in the actual preferences once commit() or apply() is called, what method in SharedPreferences.Editor should we use?

A.

delete(String key)

B.

clear()

C.

remove(String key)

D.

removeAll()

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

...

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.

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

B.

val input = context!!.getRawResource(R.raw.sample_teas)

C.

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

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.

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

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

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.

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?

A.

findPreference

B.

getPreferenceManager

C.

addPreferencesFromResource

D.

setPreferenceScreen