Labour Day Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

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

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

Last Update Apr 27, 2024
Total Questions : 128

We are offering FREE Associate-Android-Developer Google exam questions. All you do is to just go and sign up. Give your details, prepare Associate-Android-Developer free exam questions and then go for complete pool of Google Developers Certification - Associate Android Developer (Kotlin and Java Exam) test questions that will help you more.

Associate-Android-Developer pdf

Associate-Android-Developer PDF

$35  $99.99
Associate-Android-Developer Engine

Associate-Android-Developer Testing Engine

$42  $119.99
Associate-Android-Developer PDF + Engine

Associate-Android-Developer PDF + Testing Engine

$56  $159.99
Questions 1

By executing an allowMainThreadQueries() method to the room database builder

RoomDatabase.Builder, we can:

Options:

A.  

set the database factory

B.  

handle database first time creation

C.  

handle database opening

D.  

disable the main thread query check for Room

Discussion 0
Questions 2

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 Evaluate Expression you can

Options:

A.  

examine the object tree for a variable; expand it in the Variables view

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

Discussion 0
Questions 3

Filter logcat messages. If in the filter menu, a filter option “Edit Filter Configuration”? 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.

Discussion 0
Questions 4

What is the incorrect statement about Data Access Object (androidx.room.Dao)?

Options:

A.  

Data Access Objects are the main classes where you define your database interactions. They can include a variety of query methods.

B.  

The class marked with @Dao should either be an interface or an abstract class. At compile time, Room will

generate an implementation of this class when it is referenced by a Database.

C.  

An abstract @Dao class can optionally have a constructor that takes a Database as its only parameter.

D.  

It is recommended to have only one Dao class in your codebase for all tables.

Discussion 0
Questions 5

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

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

Options:

A.  

set the database factory

B.  

handle database first time creation

C.  

handle database opening

D.  

disable the main thread query check for Room

Discussion 0
Questions 6

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.

Discussion 0
Questions 7

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

Discussion 0
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

Discussion 0
Questions 9

If you want the Database Inspector to automatically update the data it presents as you interact with your running app, check the Live updates checkbox at the top of the inspector window. While live updates are enabled, what happens with the table in the inspector window?

Options:

A.  

It is still editable. You can modify data in a table by double-clicking a cell, typing a new value, and pressing Enter.

B.  

It becomes read-only and you cannot modify its values.

C.  

It becomes read-only, but you cannot see its updated values before updating the data by clicking the Refresh table button at the top of the inspector window.

Discussion 0
Questions 10

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

Discussion 0
Questions 11

Android uses adapters (from the Adapter class) to connect data with View items in a list. There are many different kinds of adapters available, and you can also write custom adapters. To connect data with View items, the adapter needs to know about the View items. From what is extended the entity that is usually used in an adapter and describes a View item and its position within the RecyclerView?

Options:

A.  

RecyclerView.AdapterDataObserver

B.  

RecyclerView.ItemDecoration

C.  

RecyclerView.ViewHolder

D.  

RecyclerViewAccessibilityDelegate

Discussion 0
Questions 12

A content label sometimes depends on information only available at runtime, or the meaning of a View might change over time. For example, a Play button might change to a Pause button during music playback. In these cases, to update the content label at the appropriate time, we can use:

Options:

A.  

View#setContentDescription(int contentDescriptionResId)

B.  

View#setContentLabel(int contentDescriptionResId)

C.  

View#setContentDescription(CharSequence contentDescription)

D.  

View#setContentLabel(CharSequence contentDescription)

Discussion 0
Questions 13

If you are working with a Builder that creates a PeriodicWorkRequest to run periodically once within the flex period of every interval period. What statement is correct?

Options:

A.  

The repeat interval must be greater than PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval must be greater than PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.

B.  

The repeat interval must be lower than or equal to PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval must be lower than or equal to PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.

C.  

The repeat interval must be greater than or equal to PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval can be anything in relation to PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.

D.  

The repeat interval must be greater than or equal to PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval must be greater than or equal to PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.

Discussion 0
Questions 14

Custom views and directional controller clicks. In general, you should send an AccessibilityEvent whenever the content of your custom view changes. For example, if a text value was changed in your custom view, you should emit an event of this type:

Options:

A.  

TYPE_WINDOWS_CHANGED

B.  

TYPE_VIEW_CONTEXT_CLICKED

C.  

TYPE_WINDOWS_CHANGED

D.  

TYPE_VIEW_TEXT_CHANGED

Discussion 0
Questions 15

Assume that you have the following situation: The app code calls for R.string.text_a Three relevant resource files are available:

-res/values/strings.xml, which includes text_a in the app's default language, in this case English.

-res/values-mcc404/strings.xml, which includes text_a in the app's default language, in this case English.

-res/values-hi/strings.xml, which includes text_a in Hindi.

The app is running on a device that has the following configuration:

-The SIM card is connected to a mobile network in India (MCC 404).

-The language is set to Hindi (hi).

Which is the correct statement below?

Options:

A.  

Android loads text_a from res/values/strings.xml (in English)

B.  

Android loads text_a from res/values-mcc404/strings.xml (in English)

C.  

Android loads text_a from res/values-hi/strings.xml (in Hindi)

Discussion 0
Questions 16

As an example. In an Activity we have our TimerViewModel object (extended ViewModel), named mTimerViewModel. mTimerViewModel.getTimer() method returns a LiveData value. What can be a correct way to set an observer to change UI in case if data was changed?

Options:

A.  

mTimerViewModel.getTimer().getValue().toString().observe(new Observer() {

@Override

public void onChanged(Long aLong) {

callAnyChangeUIMethodHere(aLong)

}

});

B.  

mTimerViewModel.getTimer().observe(this, new Observer() {

@Override

public void onChanged(Long aLong) {

callAnyChangeUIMethodHere(aLong)

}

});

C.  

mTimerViewModel.observe(new Observer() {

@Override

public void onChanged(Long aLong) {

callAnyChangeUIMethodHere(aLong)

}

});

Discussion 0
Questions 17

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

Discussion 0
Questions 18

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 create(@NonNull Class 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);

Discussion 0
Questions 19

When using an EditTexts or editable TextViews, or other editable View. What attribute to use to provide a content label for that View?

Options:

A.  

android:contentDescription

B.  

android:hint

C.  

android:labelFor

Discussion 0