Associate-Android-Developer Associate Android Developer

Loading demo links...

Showing 1–3 of 10 questions

Question 1 (KOTLIN only)

DRAG DROP

The diagram below shows a basic form of the recommended architecture for apps that use Architecture Components. The architecture consists of a UI controller, a ViewModel that serves LiveData, a Repository, and a Room database. Drag modules to correct places.

Select and Place:

Answer is in the explanation below.

Question 2 (KOTLIN only)

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

Select all that apply, then click Submit answer.

  • If more than one matching element is found, the first matching element in the layout hierarchy is returned as the target UiObject.

  • If no matching UI element is found, an IOException is thrown.

  • If more than one matching element is found, the last matching element in the layout hierarchy is returned as the target UiObject.

  • If no matching UI element is found, a UiAutomatorObjectNotFoundException is thrown.

Question 3 (KOTLIN only)

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

Select all that apply, then click Submit answer.

  • It’s a file with Room-exported schema

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

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