MCQs / Computer Science / Android OS: Architecture, Framework and Application Development

Android OS: Architecture, Framework and Application Development MCQs — Computer Science

53 multiple-choice questions on Android OS: Architecture, Framework and Application Development from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.

1. Which Jetpack library provides an SQLite object-mapping database?

  1. AppCompat
  2. Room
  3. Navigation
  4. WorkManager

Answer: B) Room

Explanation: Room is an abstraction layer over SQLite.

Discuss this question

2. The first commercial Android phone was the:

  1. Nexus One
  2. iPhone 3G
  3. HTC Dream (T-Mobile G1)
  4. Samsung Galaxy S

Answer: C) HTC Dream (T-Mobile G1)

Explanation: The HTC Dream/T-Mobile G1 launched in 2008 with Android 1.0.

Discuss this question

3. Dalvik primarily used which compilation technique?

  1. Just-In-Time (JIT)
  2. Interpretation of source code
  3. Ahead-Of-Time (AOT) only
  4. Native C compilation

Answer: A) Just-In-Time (JIT)

Explanation: Dalvik compiled bytecode to machine code at run time using JIT.

Discuss this question

4. When a dialog partially covers an activity, the activity goes to:

  1. onDestroy()
  2. onCreate()
  3. onPause()
  4. onRestart()

Answer: C) onPause()

Explanation: Losing focus while still partly visible triggers onPause().

Discuss this question

5. Material Design and ART as the default runtime came with Android:

  1. 10
  2. 5.0 Lollipop
  3. 4.0
  4. 7.0 Nougat

Answer: B) 5.0 Lollipop

Explanation: Lollipop (API 21) introduced Material Design and made ART the default.

Discuss this question

6. Before an APK can be installed it must be:

  1. Uploaded to Play
  2. Converted to IPA
  3. Digitally signed
  4. Zipped twice

Answer: C) Digitally signed

Explanation: Android only installs signed APKs (debug or release key).

Discuss this question

7. Music that keeps playing after you leave the app is usually run by a:

  1. Service
  2. Content Provider
  3. Fragment
  4. Toast

Answer: A) Service

Explanation: Services perform long-running work without a UI.

Discuss this question

8. The build system used to compile and package Android apps is:

  1. CMake only
  2. Ant
  3. Xcode build
  4. Gradle (with the Android Gradle Plugin)

Answer: D) Gradle (with the Android Gradle Plugin)

Explanation: Gradle with AGP builds Android apps.

Discuss this question

9. What is an API level?

  1. An integer that identifies the framework API version of an Android release
  2. The battery level
  3. The screen density
  4. The number of apps installed

Answer: A) An integer that identifies the framework API version of an Android release

Explanation: Each Android version has an API level, e.g. Android 14 = API 34.

Discuss this question

10. Activities are kept in the back stack in which order?

  1. Random
  2. FIFO (queue)
  3. LIFO (stack)
  4. Alphabetical

Answer: C) LIFO (stack)

Explanation: The back stack is last-in, first-out.

Discuss this question

11. Jetpack Compose is:

  1. A build tool
  2. An emulator
  3. A database library
  4. A modern declarative UI toolkit in Kotlin

Answer: D) A modern declarative UI toolkit in Kotlin

Explanation: Compose builds UI with Kotlin functions instead of XML layouts.

Discuss this question

12. The four main Android application components are:

  1. Activity, Fragment, View, Layout
  2. Activity, Service, Broadcast Receiver, Content Provider
  3. Intent, Bundle, Context, Manifest
  4. Button, TextView, EditText, Toast

Answer: B) Activity, Service, Broadcast Receiver, Content Provider

Explanation: These four components are the building blocks declared in the manifest.

Discuss this question

13. targetSdk indicates:

  1. The Android version the app has been designed and tested for
  2. The number of activities
  3. The oldest Android version supported
  4. The SDK used by the emulator only

Answer: A) The Android version the app has been designed and tested for

Explanation: targetSdk tells the system which behaviours the app expects; Play sets minimum targets.

Discuss this question

14. Releasing heavy resources when the activity is no longer visible should be done in:

  1. onStop()
  2. onRestart()
  3. onCreate()
  4. onStart()

Answer: A) onStop()

Explanation: onStop() is called when the activity is not visible.

Discuss this question

15. When the user presses Home, the activity's callbacks are:

  1. onRestart() then onStart()
  2. onDestroy() only
  3. onCreate() then onResume()
  4. onPause() then onStop()

Answer: D) onPause() then onStop()

Explanation: The activity becomes invisible: onPause() then onStop().

Discuss this question

16. Which framework service shows alerts in the status bar?

  1. Resource Manager
  2. Package Manager
  3. Content Provider
  4. Notification Manager

Answer: D) Notification Manager

Explanation: The Notification Manager displays notifications.

Discuss this question

17. Which layer contains the Phone, Contacts and Camera apps?

  1. Native libraries
  2. Kernel
  3. HAL
  4. Applications layer

Answer: D) Applications layer

Explanation: System and user apps sit at the top of the stack.

Discuss this question

18. Which tool converts Java bytecode into DEX for release builds and also shrinks code?

  1. adb
  2. D8/R8
  3. javac
  4. AAPT2

Answer: B) D8/R8

Explanation: D8 dexes the bytecode and R8 shrinks, optimises and obfuscates it.

Discuss this question

19. The object used to start activities and services is a/an:

  1. Intent
  2. Bundle
  3. Adapter
  4. Cursor

Answer: A) Intent

Explanation: Intents are messages that request an action from another component.

Discuss this question

20. Which component responds to system events such as "battery low" or "boot completed"?

  1. Activity
  2. Service
  3. Broadcast Receiver
  4. View

Answer: C) Broadcast Receiver

Explanation: Broadcast receivers listen for system or app broadcasts.

Discuss this question

21. The Android runtime used from Android 5.0 onward is:

  1. ART
  2. Dalvik
  3. JVM HotSpot
  4. V8

Answer: A) ART

Explanation: ART replaced Dalvik as the default runtime in Lollipop.

Discuss this question

22. Pressing the Back button on the top activity normally results in:

  1. onRestart()
  2. onPause() only
  3. onPause(), onStop(), onDestroy()
  4. onResume()

Answer: C) onPause(), onStop(), onDestroy()

Explanation: Back finishes the activity, so it is paused, stopped and destroyed.

Discuss this question

23. Fragments and the Action Bar were introduced in Android 3.0, named:

  1. Honeycomb
  2. Gingerbread
  3. Oreo
  4. Froyo

Answer: A) Honeycomb

Explanation: Honeycomb (API 11) was designed for tablets and added Fragments and the Action Bar.

Discuss this question

24. In which method should setContentView() normally be called?

  1. onDestroy()
  2. onResume()
  3. onCreate()
  4. onPause()

Answer: C) onCreate()

Explanation: The layout is set once in onCreate().

Discuss this question

25. Which framework component manages activity lifecycles and the back stack?

  1. Window Manager
  2. Package Manager
  3. Telephony Manager
  4. Activity Manager

Answer: D) Activity Manager

Explanation: The Activity Manager controls activity lifecycles and navigation stack.

Discuss this question

Page 1 of 3 Next

Practise Android OS: Architecture, Framework and Application Development MCQs

More Computer Science chapters