ExamGecko
Home Home / Google / Associate Android Developer

Google Associate Android Developer Practice Test - Questions Answers, Page 5

Question list
Search
Search

List of questions

Search

Related questions











To run a debuggable build variant you must use a build variant that includes

A.
minifyEnabled false in the build configuration
A.
minifyEnabled false in the build configuration
Answers
B.
debuggable true or debuggable false in the build configuration
B.
debuggable true or debuggable false in the build configuration
Answers
C.
debuggable true in the build configuration
C.
debuggable true in the build configuration
Answers
Suggested answer: C

About running a debuggable build variant. Usually, you can just select the default "debug" variant that's included in every Android Studio project (even though it's not visible in the build.gradle file). But if you define new build types that should be debuggable, you must add 'debuggable true' to the build type. Is that mostly true?

A.
Yes.
A.
Yes.
Answers
B.
No, if you define new build types that should be debuggable, you must add 'debuggable false'
B.
No, if you define new build types that should be debuggable, you must add 'debuggable false'
Answers
C.
No, the debug variant should be visible in the build.gradle file anyway.
C.
No, the debug variant should be visible in the build.gradle file anyway.
Answers
Suggested answer: A

With a room database. When performing queries, you'll often want your app's UI to update automatically when the data changes. Can you use a return value of type LiveData in your query method description to achieve this?

A.
Yes
A.
Yes
Answers
B.
No
B.
No
Answers
Suggested answer: A

Explanation:

Room generates all necessary code to update the LiveData when the database is updated.

As an example. Our MutableLiveData<Long> object, named mLapseTime, is not connected to a Room database, etc. How can we change the value in mLapseTime?

A.
mLapseTime.postValue("new String")
A.
mLapseTime.postValue("new String")
Answers
B.
mLapseTime.setValue(1000l)
B.
mLapseTime.setValue(1000l)
Answers
C.
mLapseTime.changeValue(1000l)
C.
mLapseTime.changeValue(1000l)
Answers
Suggested answer: B

Interface for a callback to be invoked when a shared preference is changed. Interface is named:

A.
android.content.SyncStatusObserver
A.
android.content.SyncStatusObserver
Answers
B.
android.content.SharedPreferences.Editor
B.
android.content.SharedPreferences.Editor
Answers
C.
android.content.SharedPreferences.OnSharedPreferenceChangeListener
C.
android.content.SharedPreferences.OnSharedPreferenceChangeListener
Answers
D.
android.content.SharedPreferences
D.
android.content.SharedPreferences
Answers
Suggested answer: C

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
A.
MODE_PRIVATE or MODE_PUBLIC
Answers
B.
combination of MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE
B.
combination of MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE
Answers
C.
Value is either 0 or a combination of MODE_PRIVATE, MODE_WORLD_READABLE,
C.
Value is either 0 or a combination of MODE_PRIVATE, MODE_WORLD_READABLE,
Answers
D.
MODE_WORLD_WRITEABLE, and MODE_MULTI_PROCESS
D.
MODE_WORLD_WRITEABLE, and MODE_MULTI_PROCESS
Answers
Suggested answer: C

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.
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.
Answers
B.
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.
B.
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.
Answers
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.
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.
Answers
D.
No any invocation of one of an InputStreamReader's read() methods can cause some bytes to be read from the underlying byte-input stream.
D.
No any invocation of one of an InputStreamReader's read() methods can cause some bytes to be read from the underlying byte-input stream.
Answers
Suggested answer: A, C

In a class extended PreferenceFragmentCompat. What method is used to inflate the given XML resource and add the preference hierarchy to the current preference hierarchy?

A.
findPreference
A.
findPreference
Answers
B.
getPreferenceManager
B.
getPreferenceManager
Answers
C.
addPreferencesFromResource
C.
addPreferencesFromResource
Answers
D.
setPreferenceScreen
D.
setPreferenceScreen
Answers
Suggested answer: C

In a class PreferenceFragmentCompat. What method is called during onCreate(Bundle) to supply the preferences for this fragment. And where subclasses are expected to call setPreferenceScreen(PreferenceScreen) either directly or via helper methods such as addPreferencesFromResource(int)?

A.
onCreateLayoutManager
A.
onCreateLayoutManager
Answers
B.
onCreatePreferences
B.
onCreatePreferences
Answers
C.
onCreateRecyclerView
C.
onCreateRecyclerView
Answers
D.
onCreateView
D.
onCreateView
Answers
Suggested answer: B

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.
onCreateLayoutManager
A.
onCreateLayoutManager
Answers
B.
onCreatePreferences
B.
onCreatePreferences
Answers
C.
onCreateRecyclerView
C.
onCreateRecyclerView
Answers
D.
onPreferenceTreeClick
D.
onPreferenceTreeClick
Answers
Suggested answer: D
Total 128 questions
Go to page: of 13