Exam Details

  • Exam Code
    :ASSOCIATE-ANDROID-DEVELOPER
  • Exam Name
    :Google Developers Certification - Associate Android Developer (Kotlin and Java Exam)
  • Certification
    :Google Certifications
  • Vendor
    :Google
  • Total Questions
    :128 Q&As
  • Last Updated
    :May 16, 2024

Google Google Certifications ASSOCIATE-ANDROID-DEVELOPER Questions & Answers

  • Question 101:

    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 the layout hierarchy is returned as the target UiObject.

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

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

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

  • Question 102:

    To automate UI tests with Android Studio, you implement your test code in a separate Android test folder. Folder could be named:

    A. app/androidTest/java

    B. app/src/androidTest/java

    C. app/java/androidTest

  • Question 103:

    Once your test has obtained a UiObject object, you can call the methods in the UiObject class to perform user interactions on the UI component represented by that object. You can specify such actions as: (Choose four.)

    A. click() : Clicks the center of the visible bounds of the UI element.

    B. touch() : Touch the center of the visible bounds of the UI element.

    C. dragTo() : Drags this object to arbitrary coordinates.

    D. moveTo() : Move this object to arbitrary coordinates.

    E. setText() : Sets the text in an editable field, after clearing the field's content. Conversely, the clearTextField() method clears the existing text in an editable field.

    F. swipeUp() : Performs the swipe up action on the UiObject. Similarly, the swipeDown(), swipeLeft (), and swipeRight() methods perform corresponding actions.

  • Question 104:

    What do you want from Room when you create a DAO method and annotate it with @Delete?

    Example:

    @Dao

    interface MyDao {@Deletefun deleteUsers(vararg users: User)

    }

    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.

  • Question 105:

    What do you want from Room when you create a DAO method and annotate it with @Update?

    Example:

    @Dao

    interface MyDao {@Updatefun updateUsers(vararg users: User)

    }

    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.

  • Question 106:

    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)

    }

    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.

  • Question 107:

    What is demonstrated by the code below?

    // RawDao.kt@Daointerface RawDao {

    @RawQueryfun getUserViaQuery(query: SupportSQLiteQuery?): User?}

    // Usage of RawDao

    ...

    val query =

    SimpleSQLiteQuery("SELECT * FROM User WHERE id = ? LIMIT 1",

    arrayOf(sortBy))val user = rawDao.getUserViaQuery(query) ...

    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.

  • Question 108:

    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 create(modelClass: Class): T { return try { //MISSED RETURN VALUE HERE” } catch (e: InstantiationException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } catch (e: IllegalAccessException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } catch (e: NoSuchMethodException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } catch (e: InvocationTargetException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } }

    What should we write instead of “//MISSED RETURN VALUE HERE”?

    A. modelClass.getConstructor().newInstance(mRepository)

    B. modelClass.getConstructor(MyRepository::class.java).newInstance()

    C. modelClass.getConstructor(MyRepository::class.java).newInstance(mRepository)

  • Question 109:

    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 do this:

    A. val input = context!!.resources.openRawResource(R.raw.sample_teas)

    B. val input = context!!.assets.open("sample_teas.json")

    C. val input = context!!.resources.assets.open("sample_teas.json")

  • Question 110:

    For example, we have a BufferedReader reader, associated with the json file through InputStreamReader. To get a file data we can do this:

    A. var line: String?try {while (reader.readLine().also { line = it } != null) {

    builder.append(line)

    }

    val json = JSONObject(builder.toString())

    return json

    } catch (exception: IOException) {

    exception.printStackTrace()

    } catch (exception: JSONException) {

    exception.printStackTrace()

    }

    B. var line: JSONObject ?try {while (reader.readJSONObject ().also { line = it } != null) {

    builder.append(line)

    }

    val json = JSONObject(builder.toString())

    return json

    } catch (exception: IOException) {

    exception.printStackTrace()

    } catch (exception: JSONException) {

    exception.printStackTrace()

    }

    return json

    } catch (exception: IOException) {

    exception.printStackTrace()

    } catch (exception: JSONException) {

    exception.printStackTrace()

    }

    C. var line: String?try {while (reader.readLine().also { line = it } != null) {

    builder.append(line)

    }

    val json = JSONObject(builder.toString())

    return json

    } catch (exception: RuntimeException) {

    exception.printStackTrace()

    } catch (exception: ArrayIndexOutOfBoundsException) {

    exception.printStackTrace()

    }

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Google exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your ASSOCIATE-ANDROID-DEVELOPER exam preparations and Google certification application, do not hesitate to visit our Vcedump.com to find your solutions here.