MCQs / Computer Science / Windows Mobile, Eclipse and Fragments

Windows Mobile, Eclipse and Fragments MCQs — Computer Science

40 multiple-choice questions on Windows Mobile, Eclipse and Fragments 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. Fragments were introduced in Android:

  1. 3.0 Honeycomb
  2. 5.0 Lollipop
  3. 8.0 Oreo
  4. 1.6

Answer: A) 3.0 Honeycomb

Explanation: Honeycomb (tablets) introduced fragments.

Discuss this question

2. Which call navigates to another destination with the Navigation component?

  1. replace(R.id.detail)
  2. setContentView(R.id.detail)
  3. startActivity(R.id.detail)
  4. findNavController().navigate(R.id.detailFragment)

Answer: D) findNavController().navigate(R.id.detailFragment)

Explanation: NavController.navigate() moves between destinations.

Discuss this question

3. The design pattern popularised by Microsoft with XAML data binding is:

  1. Singleton
  2. MVC
  3. Observer only
  4. MVVM

Answer: D) MVVM

Explanation: Model–View–ViewModel came from the WPF/XAML world.

Discuss this question

4. The most common language for Windows Phone app development was:

  1. C
  2. Dart
  3. Kotlin
  4. Swift

Answer: A) C

Explanation: Windows Phone apps were mainly written in C with XAML.

Discuss this question

5. Windows Mobile 6.x applications were typically written using:

  1. C/C++ or the .NET Compact Framework
  2. HTML only
  3. Swift
  4. Kotlin

Answer: A) C/C++ or the .NET Compact Framework

Explanation: Windows Mobile apps used native C/C++ or the .NET Compact Framework.

Discuss this question

6. Which fragment callback is the first to be called when it is linked to its activity?

  1. onCreateView()
  2. onAttach()
  3. onViewCreated()
  4. onStart()

Answer: B) onAttach()

Explanation: onAttach() is called when the fragment is associated with its host.

Discuss this question

7. Swipeable tabs where each page is a fragment are usually built with:

  1. WebView
  2. ListView and Adapter
  3. ViewPager2 and TabLayout
  4. Toast and Snackbar

Answer: C) ViewPager2 and TabLayout

Explanation: ViewPager2 hosts fragments as swipeable pages, and TabLayout shows the tabs.

Discuss this question

8. Google officially ended support for Eclipse ADT in:

  1. 2022
  2. 2015
  3. 2018
  4. 2010

Answer: B) 2015

Explanation: Support ended at the end of 2015.

Discuss this question

9. Windows Phone 7 introduced which design language?

  1. Holo
  2. Aqua
  3. Material
  4. Metro (Live Tiles)

Answer: D) Metro (Live Tiles)

Explanation: Windows Phone used the Metro design with Live Tiles.

Discuss this question

10. Which method commits a fragment transaction?

  1. execute()
  2. commit()
  3. save()
  4. run()

Answer: B) commit()

Explanation: commit() schedules the transaction.

Discuss this question

11. replace(R.id.fragmentcontainer, ProfileFragment()) will:

  1. Add ProfileFragment on top of the existing one
  2. Remove the fragment(s) in that container and add ProfileFragment
  3. Hide the container
  4. Open a new activity

Answer: B) Remove the fragment(s) in that container and add ProfileFragment

Explanation: replace = remove existing + add new.

Discuss this question

12. If the host activity is paused, its fragments:

  1. Keep running in the foreground
  2. Are also paused
  3. Move to another activity
  4. Are destroyed immediately

Answer: B) Are also paused

Explanation: Fragment lifecycles follow the host activity's lifecycle.

Discuss this question

13. Which is TRUE about fragments?

  1. They can exist without an activity
  2. They cannot have layouts
  3. They must be declared in the manifest like activities
  4. They must be hosted by an activity (or another fragment)

Answer: D) They must be hosted by an activity (or another fragment)

Explanation: Fragments always live inside a host.

Discuss this question

14. DDMS in Eclipse was used for:

  1. Designing icons
  2. Writing Kotlin
  3. Publishing to Play
  4. Debugging and monitoring devices (logs, threads, file explorer)

Answer: D) Debugging and monitoring devices (logs, threads, file explorer)

Explanation: Dalvik Debug Monitor Server provided device monitoring and debugging.

Discuss this question

15. Before Android Studio, Android apps were developed in Eclipse using which plug-in?

  1. SwiftPM
  2. XNA
  3. ADT (Android Development Tools)
  4. Gradle Plugin

Answer: C) ADT (Android Development Tools)

Explanation: The ADT plug-in added Android tools to Eclipse.

Discuss this question

16. The Fragment Result API uses which pair of methods?

  1. setFragmentResult() and setFragmentResultListener()
  2. putExtra() and getStringExtra()
  3. commit() and rollback()
  4. onSaveInstanceState() and onRestoreInstanceState()

Answer: A) setFragmentResult() and setFragmentResultListener()

Explanation: Fragments can pass results through the FragmentManager with these methods.

Discuss this question

17. The IDE used to build Windows Phone apps was:

  1. Xcode
  2. Android Studio
  3. Eclipse only
  4. Visual Studio

Answer: D) Visual Studio

Explanation: Visual Studio with the Windows Phone/Windows SDK was used.

Discuss this question

18. A major reason for the failure of Windows Phone was the:

  1. "App gap" – too few popular apps
  2. Absence of cameras
  3. Use of C
  4. Lack of touch screens

Answer: A) "App gap" – too few popular apps

Explanation: Without key apps users stayed away, and without users developers stayed away.

Discuss this question

19. Which fragment callback inflates and returns the fragment's layout?

  1. onCreateView()
  2. onDetach()
  3. onCreate()
  4. onAttach()

Answer: A) onCreateView()

Explanation: onCreateView() returns the root view of the fragment.

Discuss this question

20. In the Navigation component, destinations and actions are defined in a:

  1. Navigation graph (XML)
  2. strings.xml
  3. Manifest
  4. Gradle file

Answer: A) Navigation graph (XML)

Explanation: The navigation graph describes all destinations and actions.

Discuss this question

21. The safest place to find views and set listeners in a fragment is:

  1. onAttach()
  2. onDestroy()
  3. onDetach()
  4. onViewCreated()

Answer: D) onViewCreated()

Explanation: onViewCreated() runs after the view hierarchy is created.

Discuss this question

22. Microsoft ended support for Windows 10 Mobile on:

  1. 31 December 2022
  2. 1 January 2015
  3. 30 June 2025
  4. 14 January 2020

Answer: D) 14 January 2020

Explanation: Support ended on 14 January 2020.

Discuss this question

23. A BottomNavigationView normally shows how many top-level destinations?

  1. 3 to 5
  2. Unlimited
  3. 10 to 15
  4. 1

Answer: A) 3 to 5

Explanation: Material guidelines recommend 3 to 5 bottom navigation items.

Discuss this question

24. Android Studio is based on:

  1. NetBeans
  2. Eclipse
  3. IntelliJ IDEA
  4. Visual Studio Code

Answer: C) IntelliJ IDEA

Explanation: Android Studio is built on JetBrains IntelliJ IDEA.

Discuss this question

25. Inside an activity, which property gives the FragmentManager for its fragments?

  1. intentManager
  2. childFragmentManager
  3. fragmentManagerOf()
  4. supportFragmentManager

Answer: D) supportFragmentManager

Explanation: Activities use supportFragmentManager.

Discuss this question

Page 1 of 2 Next

Practise Windows Mobile, Eclipse and Fragments MCQs

More Computer Science chapters