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.

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 canA . examine the object tree for a variable, expand it in the Variables view....

November 15, 2023No CommentsREAD MORE +

override fun <T : ViewModel?

An example. In our ViewModelFactory (that implements ViewModelProvider.Factory) we have an instance of our Repository, named mRepository. Our ViewModel has such constructor: class MyViewModel(private val mRepository: MyRepository) : ViewModel()... Next, in our ViewModelFactory create ViewModel method (overriden) looks like this: override fun <T : ViewModel?> create(modelClass: Class<T>): T { return...

November 15, 2023No CommentsREAD MORE +

What is correct about it?

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

November 15, 2023No CommentsREAD MORE +

Can you use a return value of type LiveData in your query method description to achieve this?

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 . YesB . NoView AnswerAnswer: A Explanation: Room generates all necessary code to...

November 15, 2023No CommentsREAD MORE +

What can be a correct way to set an observer to change UI in case if data was changed?

As an example. In an Activity we have our TimerViewModel object (extended ViewModel), named mTimerViewModel. mTimerViewModel.timer method returns a LiveData<Long> 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...

November 15, 2023No CommentsREAD MORE +

What is the annotation?

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

November 14, 2023No CommentsREAD MORE +

When this is especially useful?

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

November 14, 2023No CommentsREAD MORE +

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

To run a debuggable build variant you must use a build variant that includesA . minifyEnabled false in the build configurationB . debuggable true or debuggable false in the build configurationC . debuggable true in the build configurationView AnswerAnswer: C

November 14, 2023No CommentsREAD MORE +

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

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: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 =...

November 14, 2023No CommentsREAD MORE +

Enable debugging on your device: If you are using the emulator, this is enabled by default. But for a connected device, you need to

Enable debugging on your device: If you are using the emulator, this is enabled by default. But for a connected device, you need toA . enable transfer data from the device in usb connection options.B . enable debugging in the device developer options.C . enable connection in bluetooth options.View AnswerAnswer:...

November 14, 2023No CommentsREAD MORE +