Black Friday Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: cramtick70

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

Questions 4

About running a debuggable build variant. Usually, you can just select the default "debug" variant that's included in every Android Studio project (even though it's not visible in the build.gradle file). But if you define new build types that should be debuggable, you must add ‘debuggable true’ to the build type. Is that mostly true?

Options:

A.

Yes.

B.

No, if you define new build types that should be debuggable, you must add ‘debuggable false’

C.

No, the debug variant should be visible in the build.gradle file anyway.

Buy Now
Questions 5

SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. All changes you make in an editor are batched, and not copied back to the original SharedPreferences until you call:

Options:

A.

commit()

B.

apply()

C.

commit() or apply()

Buy Now
Questions 6

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?

Options:

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

Buy Now
Questions 7

To run your local unit tests, follow these steps:

1.Be sure your project is synchronized with Gradle by clicking Sync Project in the toolbar.

2.Run your test in one of the following ways (select possible): (Choose three.)

Options:

A.

To run a single test, open the Project window, and then right-click a test and click Run.

B.

To test all methods in a class, right-click a class or method in the test file and click Run.

C.

To run all tests in a directory, right-click on the directory and select Run tests.

D.

To run all tests in Project, open the Project window, and then right-click a test and click Run.

Buy Now
Questions 8

Which build options in the Build menu to choose to delete all intermediate/cached build files.

Options:

A.

Make Module

B.

Generate Signed Bundle / APK

C.

Rebuild Project

D.

Clean Project

E.

Make Project

Buy Now
Questions 9

If you added to your build.gradle file a room.schemaLocation:

android {

defaultConfig {

javaCompileOptions {

annotationProcessorOptions {

arguments = ["room.schemaLocation": "$projectDir/schemas".toString

()]

}

}

}

}

Then, you build your app or module.

As a result you got a json file, with such path to it: app/schemas/your_app_package/db_package/DbClass/DB_VERSION.json What are the correct statements about this file? (Choose all that apply.)

Options:

A.

It’s a file with Room-exported schema

B.

Main JSONObject in this file usually should contain a number "formatVersion" and a JSONObject "database"

C.

The JSONObject "database" in this file usually should contain such objects, like "entities", "views", "setupQueries", ets.

Buy Now
Questions 10

“Set the activity content to an explicit view. This view is placed directly into the activity's view hierarchy. It can itself be a complex view hierarchy.” This can be done by calling method:

Options:

A.

findViewById

B.

setContentView

C.

setActionBar

D.

setContentTransitionManager

E.

setTheme

Buy Now
Questions 11

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

Buy Now
Questions 12

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

Buy Now
Questions 13

What method should we use with Notification.Builder to supply a PendingIntent to be sent when the notification is clicked?

Options:

A.

setContentInfo

B.

setContentIntent

C.

setDeleteIntent

Buy Now
Questions 14

Working with Custom View. Once you define the custom attributes, you can use them in layout XML files just like built-in attributes. The only difference is that your custom attributes belong to a different namespace. Instead of belonging to the http://schemas.android.com/apk/res/android namespace, they belong to:

Options:

A.

http://schemas.android.com/apk/res/[your package name]

B.

http://schemas.android.com/apk/[your package name]

C.

http://schemas.android.com/[your package name]

Buy Now
Questions 15

Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following code example shows how your test might specify a search to find the first ListView in the currently displayed UI, then search within that ListView to find a UI element with the text property Apps.

What is the correct sample?

Options:

A.

UiObject appItem = device.findObject(new UiSelector()

.className(ListView.class)

.instance(1)

.childSelector(new UiSelector()

.text("Apps")));

B.

UiObject appItem = device.findObject(new UiSelector()

.className("android.widget.ListView")

.instance(0)

.childSelector(new UiSelector()

.text("Apps")));

C.

UiObject appItem = device.findObject(new UiSelector()

.className("android.widget.ListView")

.instance(new UiSelector()

.text("Apps")));

Buy Now
Questions 16

Select a correct statement about PagedList.

Options:

A.

PagedList is content-mutable. This means that new content can be loaded into an instance of PagedList and the loaded items themselves can change once loaded.

B.

PagedList is content-immutable. This means that, although new content can be loaded into an instance of PagedList, the loaded items themselves cannot change once loaded.

C.

PagedList is content-accidental. This means that new content can be loaded into an instance of PagedList and the loaded items themselves can be changed to accidental values randomly.

Buy Now
Questions 17

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:

Options:

A.

NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)

.setContentText("Much longer text that cannot fit one line...")

.setStyle(new NotificationCompat.BigTextStyle()

.bigText("Much longer text that cannot fit one line..."))

...

B.

NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)

.setContentText("Much longer text that cannot fit one line...")

.setLongText("Much longer text that cannot fit one line..."))

...

C.

NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)

.setContentText("Much longer text that cannot fit one line...")

.setTheme(android.R.style.Theme_LongText);

...

Buy Now
Questions 18

In application theme style, flag windowDrawsSystemBarBackgrounds () indicates:

Options:

A.

whether this window should have an Action Bar in place of the usual title bar.

B.

whether there should be no title on this window.

C.

that this window should not be displayed at all.

D.

whether this is a floating window.

E.

whether this Window is responsible for drawing the background for the system bars.

Buy Now
Questions 19

Select four different types of app components. (Choose four.)

Options:

A.

Application

B.

Layouts

C.

Activities

D.

Services

E.

AlarmManager

F.

WorkManager

G.

Broadcast receivers

Buy Now
Exam Name: Google Developers Certification - Associate Android Developer (Kotlin and Java Exam)
Last Update: Nov 24, 2024
Questions: 128
Associate-Android-Developer pdf

Associate-Android-Developer PDF

$25.5  $84.99
Associate-Android-Developer Engine

Associate-Android-Developer Testing Engine

$30  $99.99
Associate-Android-Developer PDF + Engine

Associate-Android-Developer PDF + Testing Engine

$40.5  $134.99