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

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

Questions 4

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

Buy Now
Questions 5

What happens when you create a DAO method and annotate it with @Insert?

Example:

@Dao

interface MyDao {

@Insert(onConflict = OnConflictStrategy.REPLACE)

fun insertUsers(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.

Buy Now
Questions 6

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.

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

...

Buy Now
Questions 7

Select correct demonstration of WorkRequest cancellation.

Options:

A.

workManager.enqueue(OneTimeWorkRequest.Builder(FooWorker::class.java).build())

B.

val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request)

val status = workManager.getWorkInfoByIdLiveData(request.id) status.observe(...)

C.

val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWorkById(request.id)

D.

val request1: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build()

val request2: WorkRequest = OneTimeWorkRequest.Builder (BarWorker::class.java).build()

val request3: WorkRequest = OneTimeWorkRequest.Builder (BazWorker::class.java).build()

workManager.beginWith(request1, request2).then(request3).enqueue()

E.

val request: WorkRequest = OneTimeWorkRequest.Builder (FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWork(request)

Buy Now
Questions 8

The Testing Pyramid, shown in the Figure, illustrates how your app should include the three categories of tests: small, medium, and large. Small tests are unit tests that :

Options:

A.

validate your app's behavior one class at a time.

B.

validate either interactions between levels of the stack within a module, or interactions between related modules.

C.

validate user journeys spanning multiple modules of your app.

Buy Now
Questions 9

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

Buy Now
Questions 10

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?

Options:

A.

delete(String key)

B.

clear()

C.

remove(String key)

D.

removeAll()

Buy Now
Questions 11

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

Buy Now
Questions 12

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.

Buy Now
Questions 13

To build a debug APK, you can open a command line and navigate to the root of your project directory. To initiate a debug build, invoke the assembleDebug task:

gradlew assembleDebug

This creates an APK named [module_name]-debug.apk in [project_name]/[module_name]/build/outputs/apk/

Select correct statements about generated file. (Choose all that apply.)

Options:

A.

The file is already signed with the debug key

B.

The file is already aligned with zipalign

C.

You can immediately install this file on a device.

Buy Now
Questions 14

The following code snippet shows an example of an Espresso test:

Options:

A.

@Rule

public void greeterSaysHello() {

onView(withId(R.id.name_field)).do(typeText("Steve"));

onView(withId(R.id.greet_button)).do(click());

onView(withText("Hello Steve!")).check(matches(isDisplayed()));

}

B.

@Test

public void greeterSaysHello() {

onView(withId(R.id.name_field)).perform(typeText("Steve"));

onView(withId(R.id.greet_button)).perform(click());

onView(withText("Hello Steve!")).check(matches(isDisplayed()));

}

C.

@Test

public void greeterSaysHello() {

onView(withId(R.id.name_field)).do(typeText("Steve"));

onView(withId(R.id.greet_button)).do(click());

onView(withText("Hello Steve!")).compare(matches(isDisplayed()));

}

Buy Now
Questions 15

If no any folder like res/anim-, res/drawable-, res/layout-, res/raw-

, res/xml- exist in the project. Which folders are required in the project anyway? (Choose two.)

Options:

A.

res/anim/

B.

res/drawable/

C.

res/layout/

D.

res/raw/

E.

res/xml/

Buy Now
Questions 16

In application theme style, flag windowNoTitle () 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 17

Building your app from the command line, if you have a "demo" product flavor, then you can build the debug version with the command:

Options:

A.

gradlew assembleDemoDebug

B.

gradlew installDemoDebug

C.

both variants are correct.

Buy Now
Questions 18

What is demonstrated by the code below?

// RawDao.java

@Dao

interface RawDao {

@RawQuery

User getUserViaQuery(SupportSQLiteQuery query);

}

// Usage of RawDao

...

SimpleSQLiteQuery query =

new SimpleSQLiteQuery("SELECT * FROM UserWHERE id = ? LIMIT 1",

new Object[]{userId});

User user = rawDao.getUserViaQuery(query);

...

Options:

A.

A method in a Dao annotated class as a raw query method where you can pass the query as a

SupportSQLiteQuery.

B.

A method in a Dao annotated class as a query method.

C.

A method in a RoomDatabase class as a query method.

Buy Now
Questions 19

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:

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

PDF + Testing Engine

$130

Testing Engine

$95

PDF (Q&A)

$80