Here are all the actual test exam dumps for IT exams. Most people prepare for the actual exams with our test dumps to pass their exams. So it's critical to choose and actual test pdf to succeed.

Valid Associate-Android-Developer Test Answers & Google Associate-Android-Developer Exam PDF [Q41-Q65]

Share

Valid Associate-Android-Developer Test Answers & Google Associate-Android-Developer Exam PDF

Google Associate-Android-Developer Certification Real 2021 Mock Exam

NEW QUESTION 41
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:

  • A. apply()
  • B. commit() or apply()
  • C. commit()

Answer: B

 

NEW QUESTION 42
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 removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.
  • C. 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.

Answer: A

 

NEW QUESTION 43
Custom duration in milliseconds as a parameter for the setDuration method is available when you are working with:

  • A. Snackbar
  • B. for none of them
  • C. Toast
  • D. for both of them

Answer: A

 

NEW QUESTION 44
Custom views and directional controller clicks. On most devices, clicking a view using a directional controller sends (to the view currently in focus) a KeyEvent with:

  • A. KEYCODE_DPAD_CENTER
  • B. KEYCODE_BUTTON_START
  • C. KEYCODE_BUTTON_SELECT
  • D. KEYCODE_CALL

Answer: A

Explanation:
Reference:
https://developer.android.com/guide/topics/ui/accessibility/custom-views

 

NEW QUESTION 45
A content label sometimes depends on information only available at runtime, or the meaning of a View might change over time. For example, a Play button might change to a Pause button during music playback. In these cases, to update the content label at the appropriate time, we can use:

  • A. View#setContentLabel(int contentDescriptionResId)
  • B. View#setContentDescription(int contentDescriptionResId)
  • C. View#setContentDescription(CharSequence contentDescription)
  • D. View#setContentLabel(CharSequence contentDescription)

Answer: C

Explanation:
Reference:
https://support.google.com/accessibility/android/answer/7158690?hl=en

 

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

  • A. Clean Project
  • B. Generate Signed Bundle / APK
  • C. Make Project
  • D. Rebuild Project
  • E. Make Module

Answer: A

Explanation:
Reference:
https://developer.android.com/studio/run

 

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

  • A. Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND);
  • B. Intent sendIntent = new Intent(); sendIntent.setType(Intent.ACTION_SEND);
  • C. Intent sendIntent = new Intent(this, UploadService.class) sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
  • D. Intent sendIntent = new Intent(this, UploadService.class) sendIntent.setData(Uri.parse(fileUrl));

Answer: A

Explanation:
Create the text message with a string
Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage); sendIntent.setType("text/plain"); Reference:
https://developer.android.com/guide/components/fundamentals

 

NEW QUESTION 48
If content in a PagedList updates, the PagedListAdapter object receives:

  • A. a completely new PagedList that contains the updated information.
  • B. one or more items from PagedList that contains the updated information.
  • C. only one item from PagedList that contains the updated information.

Answer: A

Explanation:
Reference:
https://developer.android.com/topic/libraries/architecture/paging/ui

 

NEW QUESTION 49
With our Context we can get SharedPreferences with a method, named: getSharedPreferences (String name, int mode). What value can we transfer in a "mode"parameter?

  • A. MODE_PRIVATE or MODE_PUBLIC
  • B. combination of MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE
  • C. Value is either 0 or a combination of MODE_PRIVATE, MODE_WORLD_READABLE, D.
    MODE_WORLD_WRITEABLE, and MODE_MULTI_PROCESS

Answer: C

 

NEW QUESTION 50
By adding a RoomDatabase.Callback to the room database builder RoomDatabase.Builder (method addCallback(RoomDatabase.Callback callback)), we can: (Choose two.)

  • A. disable the main thread query check for Room
  • B. set the database factory
  • C. handle database opening
  • D. handle database first time creation

Answer: C,D

 

NEW QUESTION 51
The Log class allows you to create log messages that appear in logcat. Generally, you could use the following log methods: (Choose five.)

  • A. Log.w(String, String) (warning)
  • B. Log.e(String, String) (error)
  • C. Log.q(String, String) (questions)
  • D. Log.a(String, String) (all outputs)
  • E. Log.i(String, String) (information)
  • F. Log.v(String, String) (verbose)
  • G. Log.d(String, String) (debug)

Answer: A,B,E,F,G

 

NEW QUESTION 52
For example, suppose that in a XML file (res/menu/menu_main.xml as an example), where menu items are described, we have such item:
...
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/menu_action_settings"
app:showAsAction="never" />
...
Attribute "app:showAsAction" shows when and how this item should appear as an action item in the app bar. What value "never" in this attribute means?

  • A. Never place this item in the app bar. Instead, list the item in the app bar's overflow menu.
  • B. Also include the title text (defined by android:title) with the action item. You can include this value along with one of the others as a flag set, by separating them with a pipe.
  • C. Only place this item in the app bar if there is room for it. If there is not room for all the items marked by this value, the items with the lowest orderInCategory values are displayed as actions, and the remaining items are displayed in the overflow menu.
  • D. The action view associated with this action item (as declared by android:actionLayout or android:actionViewClass) is collapsible.
  • E. Always place this item in the app bar. Avoid using this unless it's critical that the item always appear in the action bar. Setting multiple items to always appear as action items can result in them overlapping with other UI in the app bar.

Answer: A

Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus

 

NEW QUESTION 53
Select a correct statement about PagedList.

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

Answer: B

Explanation:
Reference:
https://developer.android.com/topic/libraries/architecture/paging/ui

 

NEW QUESTION 54
In our TeaViewModel class, that extends ViewModel, we have such prorerty:
val tea: LiveData<Tea>
An observer in our Activity (type of mViewModel variable in example is TeaViewModel) is set in this way:
mViewModel!!.tea.observe(this, Observer { tea: Tea? -> displayTea(tea) }) What will be a correct displayTea method definition?

  • A. private fun displayTea()
  • B. private fun displayTea(tea: LiveData?<T>)
  • C. private fun displayTea(tea: Tea?)
  • D. private fun displayTea(tea: LiveData?<Tea>)

Answer: C

 

NEW QUESTION 55
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:

  • A. 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..."))
    ...
  • B. var builder = NotificationCompat.Builder(this, CHANNEL_ID)
    .setContentText("Much longer text that cannot fit one line...")
    .setTheme(android.R.style.Theme_LongText);
    ...
  • C. 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..."))
    ...

Answer: C

Explanation:
Reference:
https://developer.android.com/training/notify-user/build-notification

 

NEW QUESTION 56
By executing an allowMainThreadQueries() method to the room database builder RoomDatabase.Builder, we can:

  • A. handle database first time creation
  • B. handle database opening
  • C. set the database factory
  • D. disable the main thread query check for Room

Answer: D

 

NEW QUESTION 57
In application theme style, flag windowActionBar (<item name="windowActionBar">) indicates:

  • A. whether the given application component is available to other applications.
  • B. whether this window's Action Bar should overlay application content.
  • C. whether this window should have an Action Bar in place of the usual title bar.
  • D. whether action modes should overlay window content when there is not reserved space for their UI (such as an Action Bar).

Answer: C

Explanation:
Reference:
https://developer.android.com/guide/topics/ui/look-and-feel/themes https://developer.android.com/reference/android/R.styleable.html

 

NEW QUESTION 58
To handle an options menu item click in an activity, we usually should override method named:

  • A. onOptionsItemSelected
  • B. onKey
  • C. onClick

Answer: A

Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus

 

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

  • A. setContentInfo
  • B. setContentIntent
  • C. setDeleteIntent

Answer: B

Explanation:
Reference:
https://developer.android.com/training/notify-user/build-notification

 

NEW QUESTION 60
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);
...

  • A. A method in a RoomDatabase class as a query method.
  • B. A method in a Dao annotated class as a query method.
  • C. A method in a Dao annotated class as a raw query method where you can pass the query as a SupportSQLiteQuery.

Answer: C

 

NEW QUESTION 61
The easiest way of adding menu items (to specify the options menu for an activity) is inflating an XML file into the Menu via MenuInflater. With menu_main.xml we can do it in this way:

  • A. override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_main, menu) return true
    }
  • B. override fun onOptionsItemSelected(item: MenuItem): Boolean {
    menuInflater.inflate(R.menu.menu_main, menu) return super.onOptionsItemSelected(item)
    }
  • C. override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.menu.menu_main)
    }

Answer: A

Explanation:
Reference:
https://developer.android.com/guide/topics/ui/accessibility/custom-views

 

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

  • A. gradlew assembleDemoDebug
  • B. both variants are correct.
  • C. gradlew installDemoDebug

Answer: B

Explanation:
Before immediately install build on a running emulator or connected device, installDemoDebug cause an APK building.
Reference:
https://developer.android.com/studio/run

 

NEW QUESTION 63
Relative positioning is one of the basic building blocks of creating layouts in ConstraintLayout. Constraints allow you to position a given widget relative to another one. What constraints do not exist?

  • A. layout_constraintBaseline_toStartOf
  • B. layout_constraintBottom_toBottomOf
  • C. layout_constraintBaseline_toBaselineOf
  • D. layout_constraintStart_toEndOf

Answer: A

Explanation:
Reference:
https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout

 

NEW QUESTION 64
In a class PreferenceFragmentCompat. As a convenience, this fragment implements a click listener for any preference in the current hierarchy. So, in what overridden method we can handle that a preference in the tree rooted at this PreferenceScreen has been clicked?

  • A. onCreateRecyclerView
  • B. onCreateLayoutManager
  • C. onPreferenceTreeClick
  • D. onCreatePreferences

Answer: C

 

NEW QUESTION 65
......


Debugging

  • Understanding when to inspect variables through the use of Android Studio.
  • Recognizing how breakpoints can be used in Android Studio.
  • Understanding how to debug and resolve errors with the functional actions and usability of the software.
  • Understanding the fundamental debugging techniques used in Android Studio.
  • Using the Device Log for production of debug information.

 

Associate-Android-Developer Exam Questions and Valid Associate-Android-Developer Dumps PDF: https://www.actual4test.com/Associate-Android-Developer_examcollection.html