QUESTION 11 In order to run an App on as many different types of devices as poss
ID: 3593879 • Letter: Q
Question
QUESTION 11
In order to run an App on as many different types of devices as possible, you should:
A. Design the app UI to fit the largest screen among these devices.
B. Design the app UI to fit the smallest screen among these devices.
C. Use the abosulteLayout.
D. Use the relativeLayout or constraintLayout.
5 points
QUESTION 12
What is the difference between Android view’s Padding and Margin?
A. Padding is measured in absolute terms such dp. Whereas Margin is measured in relative terms such as left, right, etc.
B. Padding specifies the extra space outside of the UI element(view/layout) whereas Margin specifies the space inside of the UE element(view/layout).
C. Margin specifies the extra space outside of the UI element(view/layout) whereas Padding specifies the space inside of the UE element(view/layout).
D. No difference.
QUESTION 13
If you have a ListView that contains multiple views such as an image view, a text view, you should
A. Use the Android base Adapter class directly.
B. Use the ArrayAdapter Class directly.
C. Build a custom Adapter from the based Adapter class.
D. Build a custom Adapter from the Activity class.
5 points
QUESTION 14
Which statement is the most accurate regarding the Activity life cycle?
A. onCreate() method is invoked before the Activity object is created.
B. onCreate() method is invoked after the Activity object is created.
C. onCreate() method is invoked after the Activity is visible.
D. onCreate() method is invoked before the Activity is visible, but after onStart().
QUESTION 15
How many event handlers can you define for an event?
A. 0.
B. 1.
C. 2.
D. As many as you want.
5 points
QUESTION 16
If you start a new Activity B by calling startActivity() from an Activity A, what happens to the new Activity B when the calling Activity A is destroyed?
A. The Activity B is destroyed as well.
B. The Activity B is in an unstable state.
C. The Activity B remains in its current state.
D. The Activity B will run forever because there is no way to destroy it.
QUESTION 16
If you start a new Activity B by calling startActivity() from an Activity A, what happens to the new Activity B when the calling Activity A is destroyed?
A. The Activity B is destroyed as well.
B. The Activity B is in an unstable state.
C. The Activity B remains in its current state.
D. The Activity B will run forever because there is no way to destroy it.
QUESTION 17
How to get a response from an activity in Android?
A. startActivtyForResult()
B. startActivityToResult()
C. startActivityWithResult()
D. startActivityofResult()
5 points
QUESTION 18
Select the method that is used to access a view element of the layout resources in an Activity.
A. onCreate()
B. onStart()
C. setContentView()
D. findViewbyID()
QUESTION 19
Which of the following is not one of the four essential states of an activity?
A. Active
B. Paused
C. Stopped
D. Launched
5 points
QUESTION 20
In terms of Event handling in Android, what are the key elements you must have in your App?
A. Event Generator, Event Listener and Event Handler.
B. Event Queue, Event Listener Registration and Event Handler.
C. Event Listener, Event Listener Registration and Event Handler.
D. Event Generator, Event Queue and Event Listener.
QUESTION 21
If we ignore the two life cycle stages: Resumed and Paused, what is the correct order in the life cycle of an Activity?
A. Created -> Started -> Stopped -> Destroyed
B. Started -> Created -> Stopped -> Destroyed
C. Started -> Created -> Destroyed -> Stopped
D. Created -> Started- > Destroyed -> Stopped
5 points
QUESTION 22
In a complex App requiring a lot of computing power, efficiency is very import. Which method would you use to find out the current position/value of the SeekBar:
A. OnClick
B. onStartTrackingTouch
C. onStopTrackingTouch
D. onProgressChanged
QUESTION 23
What is the main function of an adaptor for a ListView?
A. It stores data and places the data into the row of the ListView.
B. It defines the layout for each row of the listView and places data into the row of the ListView.
C. It pulls data from a source, converts the data and places the results into the row of the ListView.
D. It connects the listView with an Array as its data source.
5 points
QUESTION 24
When you use Intent to explicitly start another Activity, the Intent is sent to:
A. Android device.
B. Andorid OS.
C. The other Activity within the same APP.
D. Another Activity in a different APP.
QUESTION 25
If you launch Activity B from Activity A and you need to receive some data to from Activity B when B is destroyed, then you need to do the following:
A. Launch B with startActivity() and define an event handler: onActivityResult().
B. Launch B with startActivity() and send some data with a Intent.
C. Launch B with startActivityForResult() and send some data with a Intent.
D. Launch B with startActivityForResult() and define an event handler: onActivityResult().
5 points
QUESTION 26
What is Log.D primarily used for?
A. To inform the end user what has happened in the App
B. To handle the events when no specific handler is defined by the App.
C. To help the App developer debug the App during development.
D. To alert the end user the app is about destroyed.
QUESTION 27
Which statement is the most accurate in the context of Android?
A. Events are placed in a Queue and Activities are placed in a Stack.
B. Events are placed in a Stack and Activities are placed in a Queue.
C. Both Events and Activities are placed in Queues.
D. Both Events and Activities are placed in Stacks.
5 points
QUESTION 28
What is the relationship between class Button and class TextView?
A. No relationship.
B. Button is inherited from TexView.
C. TextView is inherited from Button.
D. Both Button and TexView are inherited from View, but they are not inherited from each other.
QUESTION 29
When you click on a button, how many events could be generated?
A. Exactly none.
B. Exactly one event.
C. Exactly two events.
D. Potentially a number of events.
5 points
QUESTION 30
Why is ViewStub necessary sometimes?
A. It is more flexible.
B. It is more efficient in terms of memory usage.
C. A specific view can be loaded dynamically in realtime.
D. All of the above.
Explanation / Answer
12. C. Margin specifies the extra space outside of the UI element(view/layout) whereas Padding specifies the space inside of the UE element(view/layout).
Margins are outside the component and Paddings are inside the component
13. B. Use the ArrayAdapter Class directly.
By using ArrayAdapter class we can have ListView that contains multiple views.
15. D. As many as you want.
Use can you one or more event handlers at runtime.
19. D. Launched
Active, Paused, Stopped and Destroyed are four essential state of activity. Launched is not the activity.
18. A. onCreate()
onCreate() is used to access a view element of the layout.
30. D. All of the above.
All of the them are necessary sometimes.
28. D. Both Button and TexView are inherited from View, but they are not inherited from each other.
Both of them inherited from view.
26. C. To help the App developer debug the App during development.
Log.d use priority constant for println method. to debug
24. A. Android device.
To start an activity send it to the Android system.
21. A. Created -> Started -> Stopped -> Destroyed
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.