0

Android Programming Test2

Description: This quiz will test your knowledge of android programming
Number of Questions: 15
Created by:
Tags: Android Software Development Platform
Attempted 0/15 Correct 0 Score 0

Android Service is

  1. a component which runs in the foreground without direct interaction with the user

  2. a component which runs in the background without direct interaction with the user

  3. a component which runs in the foreground with direct interaction with the user

  4. a component which runs in the background with direct interaction with the user

  5. None of these


Correct Option: D
Explanation:

Option 4 is correct.

What does ANR stands for?

  1. Android not restarted

  2. Application not restarted

  3. Android not responding

  4. Application not responding

  5. None of these


Correct Option: D
Explanation:

ANR stands for Application Not Responding. It is actually a dialogue that appears to the user whenever an application is unresponsive for a long period of time.

Which of the following is the base class for all the classes in Android application?

  1. Object

  2. Class

  3. Android

  4. Root

  5. None of these


Correct Option: A
Explanation:

Object is the base class for all the classes in JAVA. There is no change in it when it comes to Android application.

Which of the following statements is not correct about the android service?

  1. It is a component which runs in the background without direct interaction with the user.

  2. These services are used for repetitive and potentially long running operations.

  3. These services run with a higher priority than inactive and invisible activities.

  4. None of these

  5. These services run in the same process, as the main thread of the application.


Correct Option: D
Explanation:

All the first 4 options are correct about an android service.

How does one prevent ANR in an android Application?

  1. Strictly follows functional programming approach to avoid ANR

  2. Ensures to follow top-down and reusable features to avoid ANR

  3. Creates a child thread and place all the actual functionality in it. So, the main thread runs with minimal periods of unresponsive time.

  4. Creates child thread for every small functionality.

  5. None of these


Correct Option: C
Explanation:

 Option 3 is correct.

ANR dialog appears on the screen in which of the following scenarios?

I. When there is no response to an input event in 5 seconds. II. When a broadcast receiver is not completed executing within 10 seconds.

  1. Only in scenario I

  2. Only in scenario II

  3. In both scenarios I and II

  4. Neither of the scenarios I and II


Correct Option: C
Explanation:

The question itself has an explanation.

Arrange the sequence of steps to install and setup Android Eclipse IDE.

  1. Create Android Virtual Device (AVD).
  2. Configure ADT plugin.
  3. Install the java development kit.
  4. Download and install the android SDK.
  5. Download the ADT plugin for eclipse.
  6. Download and install Eclipse IDE for developing android application.
  1. 1, 2, 3, 4, 5, 6

  2. 3, 4, 6, 5, 1, 2

  3. 3, 4, 5, 6, 2, 1

  4. 3, 6, 4, 5, 2, 1

  5. 6, 5, 4, 3, 2, 1


Correct Option: D
Explanation:

Correct option is 4.

Which of the following options is the correct way of registering the Event Listener?

  1. Using an Anonymous Inner class.

  2. Activity class implements the Listener interface.

  3. Using Layout file activity_main.xml to specify event handler directly.

  4. All of the above

  5. None of these


Correct Option: D
Explanation:

(a) TRUE (b) FALSE

Which of the following statements is false?

  1. The tag under a keyword string is possible.

  2. The tag under a Hex colour is possible.

  3. The tag under a reference to another resource type is possible.

  4. The tag under another item tag is possible.

  5. -


Correct Option: D
Explanation:

<item> tag in another item tag is not possible. A Keyword string, Hex colour and a reference to another resource type are possible values to an <item> tag.

Match the following:

1. Event A. Object that receives notification when an event happens.
2. Event Handler B. A method that actually handles the event
3. Event Listener C. Button Presses, Touching the screen
  1. 1 – A, 2 – B, 3 – C

  2. 1 – B, 2 – C, 3 – A

  3. 1 – C, 2 – B, 3 – A

  4. 1 – C, 2 – A, 3 – B

  5. Mappings are not possible with the given information.


Correct Option: C
Explanation:

Correct option is (3).

Which of the following is not a callback method defined by Service base calss?

  1. onStartCommand()

  2. onBind()

  3. onUnbind()

  4. onIntent()

  5. onDestroy()


Correct Option: D
Explanation:

Object is the base class for all the classes in JAVA. There is no change in it when it comes to Android application. Context is the base class for activity class in an android application.

Which of the following statements is TRUE about Events?

  1. Events are useful way to collect data about a user's interaction with interactive components of your app.

  2. Events are usually generated in response to an external action.

  3. Most commonly used event (any android application), is interaction with touch screen.

  4. All of the above

  5. Android framework maintains an event queue into which events are placed as they occur.


Correct Option: D
Explanation:

Yes, all the above points are absolutely correct about an event related to android application.

Which of the following is/are not UI controls that are provided by Android?

I. TextView II. EditText III. AutoCompleteTextView IV. Button V. ImageButton VI. CheckBox VII. ToggleButton VIII. Radiobutton IX. RadioGroup X. ProgressBar XI. Spinner XII. TimePicker XIII. DatePicker XIV. TimezonePicker XV. MenuBar

  1. Only XI

  2. Only XI, XIV and XV

  3. Only XIV and XV

  4. Only I and II

  5. Only III and IV


Correct Option: C
Explanation:

Android provides number of UI controls that help to build the graphical user interface for any app. TimezonePicker and MenuBar are not the android supported UI controls.

Which of the following pieces of code sets the theme to all the activities in the application?

  1. <application android.theme=”@style/CustomTheme”>

  2. <application android:theme=”@style/CustomTheme”>

  3. <activity android.theme=”@style/CustomTheme”>

  4. <activity android:theme=”@style/CustomTheme”>

  5. -


Correct Option: B
Explanation:

To set the theme to all the activities in an android application, <application> tag has to be used.

Match the Event Handlers with the Event listeners:

   
1. onClick() A. OnFocusChangeListener()
2. onLongClick() B. OnClickListener()
3. onFocusChange() C. OnLongClickListener()
4. onKey() D. OnMenuItemClickListener()
5. onTouch() E. OnTouchListener()
6. onMenuItemClick() F. OnKeyListener()
  1. 1 – A, 2 – B, 3 – C, 4 – D, 5 – E, 6 – F

  2. 1 – B, 2 – C, 3 – A, 4 – F, 5 – E, 6 – D

  3. 1 – C, 2 – B, 3 – A, 4 – E, 5 – F, 6 – D

  4. 1 – A, 2 – C, 3 – B, 4 – D, 5 – F, 6 – E

  5. 1 – E, 2 – C, 3 – B, 4 – D, 5 – F, 6 – A


Correct Option: B
Explanation:

Here the mapping of the Event Handlers and Event Listeners are very simple. But, notice that they are case sensitive. With the help of Eclipse IDE, this is easy enough.

- Hide questions