Android Processes

Android_threads

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

View.post(runnable) is a

  1. worker thread
  2. UI thread
  3. service call
  4. foreground process
Question 2 Multiple Choice (Single Answer)

onPostExecute(…) method of AsyncTask is

  1. work on worker thread
  2. work on UI thread
  3. work on background thread
  4. work on foreground thread
Question 3 Multiple Choice (Single Answer)

The value returned by doInBackground() of AsyncTask is sent to

  1. android OS
  2. calling component
  3. onPostExecute(…) method of AsyncTask
  4. onProgressUpdate() method of AsyncTask
Question 4 Multiple Choice (Single Answer)

Which of the following processes is called ‘Visible Process’ in android?

  1. A dialog shown on an activity in background
  2. The activity on which a dialog is shown
  3. A button on the dialog
  4. All of the above
Question 5 Multiple Choice (Single Answer)

Which of the following processes is called ‘Foreground Process’ in android?

  1. A dialog shown on an activity in background
  2. The activity on which a dialog shown
  3. A button on the dialog
  4. All of the above
Question 6 Multiple Choice (Single Answer)

Runnable is a/an

  1. class used to implement multithreading
  2. process used to implement multithreading
  3. interface used to implement multithreading
  4. None of these
Question 7 Multiple Choice (Single Answer)

_______ method of thread class creates a background process.

  1. Start()
  2. Thread(…)
  3. Run()
  4. Both (1) and (3)
Question 8 Multiple Choice (Single Answer)

________ should be used to run a process after completion of background process.

  1. Handler class
  2. View.postDelayed(Runnable, long)
  3. onPostExecute(…) method of AsyncTask
  4. Both (1) and (3)
Question 9 Multiple Choice (Single Answer)

A service is a/an

  1. background process
  2. application component
  3. empty process
  4. None of these
Question 10 Multiple Choice (Single Answer)

onStartCommand() method of service gets called when

  1. service is started through activity
  2. service binds with any component
  3. Both (1) and (2)
  4. None of these
Question 11 Multiple Choice (Single Answer)

onCreate() method of Service gets called when

  1. service is started through activity
  2. service binds with any component
  3. Both (1) and (2)
  4. None of these
Question 12 Multiple Choice (Single Answer)

What is needed to run service?

  1. To add permission in manifest
  2. To register in manifest
  3. Both (1) and (2)
  4. Nothing is required
Question 13 Multiple Choice (Single Answer)

________ service keeps running in background, even if calling component gets destroyed.

  1. Service started using startService()
  2. Service created with bindService()
  3. Both (1) and (2)
  4. Service can’t run independently
Question 14 Multiple Choice (Single Answer)

Which of the following statements is true?

(a) Service can start independently.
(b) Another android component can start service.

  1. Both (a) and (b)
  2. Only (a)
  3. Only (b)
  4. None of these
Question 15 Multiple Choice (Single Answer)

What is needed to stop normal service?

  1. Calling component needs to call stop service.
  2. Service can self stop.
  3. Both (1) and (2) are correct.
  4. It will stop automatically if calling component is destroyed.