Google Associate Android Developer Exam Dumps - Practice Questions - Post 46

#Advertisement

Google Associate Android Developer Exam Dumps - Practice Questions - Post 46

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

Page: Page 8

Option A: Log.e(String, String) (error)

Option B: Log.a(String, String) (all outputs)

Option C: Log.w(String, String) (warning)

Option D: Log.i(String, String) (information)

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


2. Filter logcat messages. If in the filter menu, a filter option “Show only selected application”? means:

Page: Page 8

Option A: Display the messages produced by the app code only (the default). Logcat filters the log messages using the PID of the active app.

Option B: Apply no filters. Logcat displays all log messages from the device, regardless of which process you selected.

Option C: Create or modify a custom filter. For example, you could create a filter to view log messages from two apps at the same time.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


3. Filter logcat messages. If in the filter menu, a filter option “Edit Filter Configuration”? means:

Page: Page 9

Option A: Display the messages produced by the app code only (the default). Logcat filters the log messages using the PID of the active app.

Option B: Apply no filters. Logcat displays all log messages from the device, regardless of which process you selected.

Option C: Create or modify a custom filter. For example, you could create a filter to view log messages from two apps at the same time.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


4. The Layout Inspector in Android Studio allows you to compare your app layout with design mockups, display a magnified or 3D view of your app, and examine details of its layout at runtime. When this is especially useful?

Page: Page 9

Option A: when your layout is built entirely in XML rather than runtime and the layout is behaving expectedly.

Option B: when your layout is built at runtime rather than entirely in XML and the layout is behaving unexpectedly.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


5. If you want the Database Inspector to automatically update the data it presents as you interact with your running app, check the Live updates checkbox at the top of the inspector window. While live updates are enabled, what happens with the table in the inspector window?

Page: Page 9

Option A: It is still editable. You can modify data in a table by double-clicking a cell, typing a new value, and pressing Enter.

Option B: It becomes read-only and you cannot modify its values.

Option C: It becomes read-only, but you cannot see its updated values before updating the data by clicking the Refresh table button at the top of the inspector window.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


6. Enable debugging on your device: If you are using the emulator, this is enabled by default. But for a connected device, you need to

Page: Page 9

Option A: enable transfer data from the device in usb connection options.

Option B: enable debugging in the device developer options.

Option C: enable connection in bluetooth options.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


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

Page: Page 10

Option A: minifyEnabled false in the build configuration

Option B: debuggable true or debuggable false in the build configuration

Option C: debuggable true in the build configuration

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


8. 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?

Page: Page 10

Option A: Yes.

Option B: No, if you define new build types that should be debuggable, you must add ‘debuggable false’

Option C: No, the debug variant should be visible in the build.gradle file anyway.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


9. 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?

Page: Page 10

Option A: Yes

Option B: No

Answer(s):

Explanation:

SEO Keywords: SEO keywords not available


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

Page: Page 10

Option A: mLapseTime.postValue(“new String”)

Option B: mLapseTime.setValue(1000l)

Option C: mLapseTime.changeValue(1000l)

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


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

Page: Page 11

Option A: android.content.SyncStatusObserver

Option B: android.content.SharedPreferences.Editor

Option C: android.content.SharedPreferences.OnSharedPreferenceChangeListener

Option D: android.content.SharedPreferences

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


12. 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?

Page: Page 11

Option A: MODE_PRIVATE or MODE_PUBLIC

Option B: combination of MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE

Option C: Value is either 0 or a combination of MODE_PRIVATE, MODE_WORLD_READABLE, D. MODE_WORLD_WRITEABLE, and MODE_MULTI_PROCESS

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


13. What statements about InputStreamReader (java.io.InputStreamReader) are correct? (Choose two.)

Page: Page 11

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

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

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

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

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


14. 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?

Page: Page 11

Option A: findPreference

Option B: getPreferenceManager

Option C: addPreferencesFromResource

Option D: setPreferenceScreen

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


15. 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)?

Page: Page 12

Option A: onCreateLayoutManager

Option B: onCreatePreferences

Option C: onCreateRecyclerView

Option D: onCreateView

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


16. 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?

Page: Page 12

Option A: onCreateLayoutManager

Option B: onCreatePreferences

Option C: onCreateRecyclerView

Option D: onPreferenceTreeClick

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


17. 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:

Page: Page 12

Option A: commit()

Option B: apply()

Option C: commit() or apply()

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


18. 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?

Page: Page 12

Option A: delete(String key)

Option B: clear()

Option C: remove(String key)

Option D: removeAll()

Answer(s):

Explanation:

SEO Keywords: SEO keywords not available


19. What is the incorrect statement about Data Access Object (androidx.room.Dao)?

Page: Page 13

Option A: Data Access Objects are the main classes where you define your database interactions. They can include a variety of query methods.

Option B: The class marked with @Dao should either be an interface or an abstract class. At compile time, Room will generate an implementation of this class when it is referenced by a Database.

Option C: An abstract @Dao class can optionally have a constructor that takes a Database as its only parameter.

Option D: It is recommended to have only one Dao class in your codebase for all tables.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


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

Page: Page 13

Option A: set the database factory

Option B: handle database first time creation

Option C: handle database opening

Option D: disable the main thread query check for Room

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


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

Page: Page 13

Option A: set the database factory

Option B: handle database first time creation

Option C: handle database opening

Option D: disable the main thread query check for Room

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


22. 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?

Page: Page 13

Option A: room.expandProjection

Option B: room.incremental

Option C: room.schemaLocation

Answer(s):

Explanation:

SEO Keywords: SEO keywords not available


23. If you added to your build.gradle file a room.schemaLocation: android { defaultConfig { javaCompileOptions { annotationProcessorOptions { arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] } } } } Then, you build your app or module. As a result you got a json file, with such path to it: app/schemas/your_app_package/db_package/DbClass/DB_VERSION.json What are the correct statements about this file? (Choose all that apply.)

Page: Page 14

Option A: It’s a file with Room-exported schema

Option B: Main JSONObject in this file usually should contain a number "formatVersion" and a JSONObject "database"

Option C: The JSONObject "database" in this file usually should contain such objects, like "entities", "views", "setupQueries", ets.

Answer(s):

Explanation:

SEO Keywords: SEO keywords not available


24. Select 3 major components of the Room. (Choose three.)

Page: Page 14

Option A: @Entity

Option B: @Query

Option C: @RawQuery

Option D: @DAO

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


25. With recommended app architecture. Fill the following diagram, which shows how all the modules usually should interact with one another after designing the app (drag modules to correct places). Select and Place: Exhibit A: Exhibit B:

Page: Page 14

Option A: Please refer to Exhibit B for answer.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


26. 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:

Page: Page 14

Option A: Activity/Fragment

Option B: ViewModel

Option C: Repository

Option D: Room database

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


27. The diagram below shows a basic form of the recommended architecture for apps that use Architecture Components. The architecture consists of a UI controller, a ViewModel that serves LiveData, a Repository, and a Room database. Drag modules to correct places. Select and Place: Exhibit A: Exhibit B:

Page: Page 15

Option A: Please refer to Exhibit B for answer.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


28. @Query is the main annotation used in DAO classes. It allows you to perform read/write operations on a database. Each @Query method is verified at compile time, so what happens if there is a problem with the query?

Page: Page 15

Option A: a runtime error occurs instead of a compilation failure.

Option B: a compilation error occurs instead of a runtime failure.

Option C: both compilation error and runtime failure occurs.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


29. About queries in DAO classes. Room verifies the return value of the query such that if the name of the field in the returned object doesn't match the corresponding column names in the query response, Room alerts you in one of the following two ways: (Choose two.)

Page: Page 15

Option A: It gives a warning if no field names match.

Option B: It gives a warning if only some field names match.

Option C: It gives an error if no field names match.

Option D: It gives an error if only some field names match.

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


30. Select four different types of app components. (Choose four.)

Page: Page 15

Option A: Application

Option B: Layouts

Option C: Activities

Option D: Services

Answer(s):

Explanation: Not available

SEO Keywords: SEO keywords not available


Top Post Ad

Post a Comment