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

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

}

When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can then use the tools in the Debugger tab to identify the state of the app. With Step Into you can

A.

examine the object tree for a variable, expand it in the Variables view. If the Variables view is not visible

B.

evaluate an expression at the current execution point

C.

advance to the next line in the code (without entering a method)

D.

advance to the first line inside a method call

E.

advance to the next line outside the current method

F.

continue running the app normally

Room can export your database's schema information into a JSON file at compile time. What annotation processor property you should set in your app/build.gradle file to export the schema?

A.

room.expandProjection

B.

room.incremental

C.

room.schemaLocation

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

With a room database. When performing queries, you'll often want your app's UI to update automatically when the data changes. Can you use a return value of type LiveData in your query method description to achieve this?

A.

Yes

B.

No

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)

)

What is a correct part of an Implicit Intent for sharing data implementation?

A.

val sendIntent = Intent(this, UploadService::class.java).apply { putExtra(Intent.EXTRA_TEXT, textMessage)

...

B.

val sendIntent = Intent().apply { type = Intent.ACTION_SEND;

...

C.

val sendIntent = Intent(this, UploadService::class.java).apply { data = Uri.parse(fileUrl)

...

D.

val sendIntent = Intent().apply { action = Intent.ACTION_SEND

...

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

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