Use Real Associate-Android-Developer - 100% Cover Real Exam Questions [Sep-2021]
Dumps Brief Outline Of The Associate-Android-Developer Exam - ActualTorrent
NEW QUESTION 21
Custom duration in milliseconds as a parameter for the setDuration method is available when you are working with:
- A. for none of them
- B. for both of them
- C. Snackbar
- D. Toast
Answer: C
NEW QUESTION 22
What is a correct part of an Implicit Intent for sharing data implementation?
- A. Intent sendIntent = new Intent(this, UploadService.class) sendIntent.setData(Uri.parse(fileUrl));
- B. Intent sendIntent = new Intent(this, UploadService.class) sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
- C. Intent sendIntent = new Intent(); sendIntent.setType(Intent.ACTION_SEND);
- D. Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND);
Answer: D
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 23
In Android 8.0, API level 26, some APIs regarding notification behaviors were moved from Notification to NotificationChannel. For example, what should we use instead of NotificationCompat.Builder.setPriority() for Android 8.0 and higher?
- A. NotificationChannel.setPriority()
- B. NotificationChannel.setImportance()
- C. NotificationCompat.Builder.setImportance()
Answer: B
Explanation:
Reference:
https://developer.android.com/training/notify-user/build-notification
NEW QUESTION 24
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
public boolean onOptionsItemSelected(MenuItem item) {
getMenuInflater().inflate(R.menu.menu_main, menu); return super.onOptionsItemSelected(item);
} - B. @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
} - C. @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.menu.menu_main);
}
Answer: B
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus
NEW QUESTION 25
When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can
- A. evaluate an expression at the current execution point
- B. continue running the app normally
- C. advance to the next line in the code (without entering a method)
- D. advance to the first line inside a method call
- E. advance to the next line outside the current method
- F. examine the object tree for a variable; expand it in the Variables view. If the Variables view is not visible
Answer: E
NEW QUESTION 26
Working with Custom View. Once you define the custom attributes, you can use them in layout XML files just like built-in attributes. The only difference is that your custom attributes belong to a different namespace. Instead of belonging to the http://schemas.android.com/apk/res/android namespace, they belong to:
- A. http://schemas.android.com/apk/[your package name]
- B. http://schemas.android.com/[your package name]
- C. http://schemas.android.com/apk/res/[your package name]
Answer: C
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/custom-components
NEW QUESTION 27
Filter logcat messages. If in the filter menu, a filter option "Show only selected application"? means:
- A. Create or modify a custom filter. For example, you could create a filter to view log messages from two apps at the same time.
- B. Apply no filters. Logcat displays all log messages from the device, regardless of which process you selected.
- C. Display the messages produced by the app code only (the default). Logcat filters the log messages using the PID of the active app.
Answer: C
NEW QUESTION 28
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 29
An example. In our ViewModelFactory (that implements ViewModelProvider.Factory) we have an instance of our Repository, named mRepository. Our ViewModel has such constructor:
public MyViewModel(MyRepository myRepository)...
Next, in our ViewModelFactory create ViewModel method (overriden) looks like this:
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) { try {
//MISSED RETURN VALUE HERE
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { throw new RuntimeException("Cannot create an instance of " + modelClass, e);
}
}
What should we write instead of "//MISSED RETURN VALUE HERE"?
- A. return modelClass.getConstructor(MyRepository.class)
.newInstance(mRepository); - B. return modelClass.getConstructor(MyRepository.class)
.newInstance(); - C. return modelClass.getConstructor()
.newInstance(mRepository);
Answer: A
NEW QUESTION 30
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 31
Assume that an app includes a default set of graphics and two other sets of graphics, each optimized for a different device setup:
res/drawable/
Contains default graphics. res/drawable-small-land-stylus/
Contains graphics optimized for use with a device that expects input from a stylus and has a QVGA low- density screen in landscape orientation. res/drawable-ja/ Contains graphics optimized for use with Japanese.
What happens if the app runs on a device that is configured to use Japanese and, at the same time, the device happens to be one that expects input from a stylus and has a QVGA low-density screen in landscape orientation?
- A. Android loads graphics from res/drawable-ja/
- B. Android loads graphics from res/drawable-small-land-stylus/
- C. Android loads graphics from res/drawable/
Answer: A
Explanation:
Reference:
https://developer.android.com/guide/topics/resources/localization
NEW QUESTION 32
Select a correct statement about PagedList.
- A. 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.
- B. 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.
- C. 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.
Answer: C
Explanation:
Reference:
https://developer.android.com/topic/libraries/architecture/paging/ui
NEW QUESTION 33
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 34
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_BUTTON_SELECT
- B. KEYCODE_DPAD_CENTER
- C. KEYCODE_BUTTON_START
- D. KEYCODE_CALL
Answer: B
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/accessibility/custom-views
NEW QUESTION 35
By adding a RoomDatabase.Callback to the room database builder RoomDatabase.Builder (method addCallback(RoomDatabase.Callback callback)), we can: (Choose two.)
- A. set the database factory
- B. handle database opening
- C. disable the main thread query check for Room
- D. handle database first time creation
Answer: B,D
NEW QUESTION 36
Android uses adapters (from the Adapter class) to connect data with View items in a list. There are many different kinds of adapters available, and you can also write custom adapters. To connect data with View items, the adapter needs to know about the View items. From what is extended the entity that is usually used in an adapter and describes a View item and its position within the RecyclerView?
- A. RecyclerViewAccessibilityDelegate
- B. RecyclerView.ItemDecoration
- C. RecyclerView.AdapterDataObserver
- D. RecyclerView.ViewHolder
Answer: D
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/layout/recyclerview
NEW QUESTION 37
Move the major components of the Android platform to correct places in diagram.
Answer:
Explanation:
Reference:
https://developer.android.com/guide/platform
NEW QUESTION 38
......
Certification Training for Associate-Android-Developer Exam Dumps Test Engine: https://www.actualtorrent.com/Associate-Android-Developer-questions-answers.html