[Oct 01, 2021] Get Free Updates Up to 365 days On Developing Associate-Android-Developer Braindumps [Q42-Q66]

Share

[Oct 01, 2021] Get Free Updates Up to 365 days On Developing Associate-Android-Developer Braindumps

Best Quality Google Associate-Android-Developer Exam Questions

NEW QUESTION 42
Room can export your database's schema information into a JSON file at compile time. What annotation processor property you should set in your app/build.gradle file to export the schema?

  • A. room.schemaLocation
  • B. room.expandProjection
  • C. room.incremental

Answer: A

Explanation:
android {
...
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation":
"$projectDir/schemas".toString()]
}
}
}
}

 

NEW QUESTION 43
In application theme style, value statusBarColor (<item name="android:statusBarColor">) means:

  • A. The color for the navigation bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE and View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION. For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation.
    Corresponds to Window.setNavigationBarColor(int).
  • B. The color for the status bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE and View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN.
    For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the status bar must not have been requested to be translucent with R.attr.windowTranslucentStatus. Corresponds to Window.setStatusBarColor(int).
  • C. Shows a thin line of the specified color between the navigation bar and the app content.
    For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation. Corresponds to Window.setNavigationBarDividerColor(int).
  • D. Color of text (usually same as colorForeground).

Answer: B

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

 

NEW QUESTION 44
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.assets.open("sample_teas.json")
  • B. val input = context!!.resources.openRawResource(R.raw.sample_teas)
  • C. val input = context!!.assets.open("sample_teas.json")

Answer: C

 

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

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

Answer: C

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

 

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

  • A. whether there should be no title on this window.
  • B. whether this window should have an Action Bar in place of the usual title bar.
  • C. whether this Window is responsible for drawing the background for the system bars.
  • D. whether this is a floating window.
  • E. that this window should not be displayed at all.

Answer: A

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

 

NEW QUESTION 47
When using an ImageView, ImageButton, CheckBox, or other View that conveys information graphically. What attribute to use to provide a content label for that View?

  • A. android:labelFor
  • B. android:hint
  • C. android:contentDescription

Answer: C

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

 

NEW QUESTION 48
What do you want from Room when you create a DAO method and annotate it with @Delete?
Example:
@Dao
public interface MyDao {
@Delete
public void deleteUsers(User... users);
}

  • A. Room removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.
  • 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 generates an implementation that inserts all parameters into the database in a single transaction.

Answer: A

 

NEW QUESTION 49
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)
}

  • A. 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.
  • 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 generates an implementation that inserts all parameters into the database in a single transaction.

Answer: A

 

NEW QUESTION 50
What statements about InputStreamReader (java.io.InputStreamReader) are correct? (Choose two.)

  • A. An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.
  • B. No any invocation of one of an InputStreamReader's read() methods can cause some bytes to be read from the underlying byte-input stream.
  • C. Each invocation of one of an InputStreamReader's read() methods may cause one or more bytes to be read from the underlying byte-input stream. To enable the efficient conversion of bytes to characters, more bytes may be read ahead from the underlying stream than are necessary to satisfy the current read operation.
  • D. An InputStreamReader is a bridge from character streams to byte streams: It reads characters using a specified charset and encodes them into bytes. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

Answer: A,C

 

NEW QUESTION 51
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()
    }
  • 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()
    }

Answer: A

 

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

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

Answer: C

 

NEW QUESTION 53
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.d(String, String) (debug)
  • B. Log.a(String, String) (all outputs)
  • C. Log.w(String, String) (warning)
  • D. Log.e(String, String) (error)
  • E. Log.q(String, String) (questions)
  • F. Log.i(String, String) (information)
  • G. Log.v(String, String) (verbose)

Answer: A,C,D,F,G

 

NEW QUESTION 54
What do you want from Room when you create a DAO method and annotate it with @Delete?
Example:
@Dao
interface MyDao {
@Delete
fun deleteUsers(vararg users: User)
}

  • A. Room removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.
  • 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 generates an implementation that inserts all parameters into the database in a single transaction.

Answer: A

 

NEW QUESTION 55
What happens when you create a DAO method and annotate it with @Insert?
Example:
@Dao
public interface MyDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
public void insertUsers(User... users);
}

  • A. 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.
  • 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 generates an implementation that inserts all parameters into the database in a single transaction.

Answer: C

 

NEW QUESTION 56
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?<Tea>)
  • C. private fun displayTea(tea: Tea?)
  • D. private fun displayTea(tea: LiveData?<T>)

Answer: C

 

NEW QUESTION 57
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?

  • A. remove(String key)
  • B. removeAll()
  • C. clear()
  • D. delete(String key)

Answer: C

Explanation:
clear() method marks in the editor to remove ALL values from the preferences. Once commit is called, the only remaining preferences will be any that you have defined in this editor.
And no delete and removeAll method exists in SharedPreferences.Editor

 

NEW QUESTION 58
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 59
A class that you create for managing multiple data sources. In addition to a Room database, this class could manage remote data sources such as a web server. It is about:

  • A. ViewModel
  • B. Room database
  • C. Activity/Fragment
  • D. Repository

Answer: D

 

NEW QUESTION 60
We have a custom view that extends android.widget.ProgressBar. Our progress bar is not touchable, focusable, etc.: it just shows progress. Style for our custom progress bar extends
"Widget.AppCompat.ProgressBar.Horizontal". An item, named "progressDrawable", in our style, is a xml file . What we usually can see as a main single element in this xml file:

  • A. A State List (<selector> element )
  • B. A Layer List (<layer-list> element) with items android:id="@+id/progress" and android:id="@+id/ background" inside it.
  • C. An <ImageView> element with android:id="@+id/progress" identifier

Answer: B

Explanation:
Reference:
https://developer.android.com/guide/topics/resources/drawable-resource

 

NEW QUESTION 61
If you want get a debuggable APK that people can install without adb, in Android Studio you can:

  • A. Select your debug variant and click Build Bundle(s) / APK(s) > Build APK(s).
  • B. Select your debug variant and click Analyze APK.
  • C. Click the Run button from toolbar

Answer: A

Explanation:
The Run button builds an APK with testOnly="true", which means the APK can only be installed via adb (which Android Studio uses). If you want a debuggable APK that people can install without adb, select your debug variant and click Build Bundle(s) / APK(s) > Build APK(s).
Reference:
https://developer.android.com/studio/run

 

NEW QUESTION 62
To create a basic JUnit 4 test class, create a class that contains one or more test methods. A test method begins with the specific annotation and contains the code to exercise and verify a single functionality in the component that you want to test. What is the annotation?

  • A. @RunWith
  • B. @LargeTest
  • C. @Rule
  • D. @Test

Answer: D

 

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_constraintStart_toEndOf
  • B. layout_constraintBaseline_toBaselineOf
  • C. layout_constraintBaseline_toStartOf
  • D. layout_constraintBottom_toBottomOf

Answer: C

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

 

NEW QUESTION 64
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 doing this:

  • A. InputStream input = context.getResources().getAssets().open ("sample_teas.json");
  • B. InputStream input = context.getAssets().open("sample_teas.json");
  • C. InputStream input = context.getResources().openRawResource(R.raw.sample_teas);

Answer: B

 

NEW QUESTION 65
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 66
......

Google Exam Practice Test To Gain Brilliante Result: https://www.validvce.com/Associate-Android-Developer-exam-collection.html