Google Associate Android Developer Associate-Android-Developer Exam Questions

Page: 1 / 14
Total 128 questions
Question 1

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)

}



Answer : A


Question 2

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 User WHERE id = ? LIMIT 1",

new Object[]{userId});

User user = rawDao.getUserViaQuery(query);

...



Answer : A


Question 3

For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:

android:title="@string/pref_notification_title" android:summary="@string/pref_notification_summary" android:defaultValue="@bool/pref_notification_default_value" app:iconSpaceReserved="false"/>

In our Fragment, we can dynamically get current notification preference value in this way:



Answer : A


Question 4

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 Step Into you can



Answer : D


Question 5

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



Question 6

What is a correct part of an Implicit Intent for sharing data implementation?



Answer : D

Create the text message with a string

val sendIntent = Intent().apply { action = Intent.ACTION_SEND

putExtra(Intent.EXTRA_TEXT, textMessage) type = 'text/plain'

}


https://developer.android.com/guide/components/fundamentals

Question 7

For example, we have a BufferedReader reader, associated with the json file through

InputStreamReader. To get a file data we can do this:



Answer : A


Page:    1 / 14   
Total 128 questions