android banner

Android Multiple Choice Questions (MCQs) and Answers

Master Android with Practice MCQs. Explore our curated collection of Multiple Choice Questions. Ideal for placement and interview preparation, our questions range from basic to advanced, ensuring comprehensive coverage of Android concepts. Begin your placement preparation journey now!

Q91

Q91 An app crashes when making a network call on the main thread. What is the most likely cause?

A

No internet connection

B

Network call is blocking the main thread

C

Invalid API key

D

Timeout error

Q92

Q92 What is the purpose of a Service in Android?

A

To handle UI components

B

To run long-running tasks in the background

C

To manage the app's lifecycle

D

To store data

Q93

Q93 What is the difference between a started Service and a bound Service in Android?

A

Started Service runs indefinitely, Bound Service is tied to a component

B

Started Service handles user input, Bound Service doesn't

C

Started Service has a UI, Bound Service does not

D

There is no difference

Q94

Q94 Which type of Service is used to perform tasks in response to explicit user interaction in Android?

A

Started Service

B

Foreground Service

C

Bound Service

D

Background Service

Q95

Q95 What is the primary benefit of using WorkManager in Android for background tasks?

A

It handles large file uploads

B

It simplifies scheduling reliable background tasks

C

It manages memory

D

It handles network requests

Q96

Q96 When should you use a JobScheduler over a Service in Android?

A

When the task requires UI updates

B

When background tasks need to be scheduled and deferred

C

When handling network connections

D

When tasks need to be run immediately

Q97

Q97 How do you start a Service in Android?

A

startService(new Intent(this, MyService.class));

B

startBackgroundService();

C

runService();

D

bindService();

Q98

Q98 How do you create a foreground Service in Android?

A

Start the Service and call startForeground()

B

Bind the Service to an Activity

C

Call startForegroundService()

D

Use a background thread

Q99

Q99 How do you stop a Service in Android?

A

stopService();

B

terminateService();

C

stopForegroundService();

D

killService();

Q100

Q100 Why would an Android Service fail to start?

A

The Service is not declared in AndroidManifest

B

The Service is missing a layout file

C

The app has no internet

D

The Service uses too much memory

Q101

Q101 An Android app crashes when trying to bind to a Service. What is a likely cause?

A

The Service is already running

B

The Service is not declared in the manifest

C

The Service is running on the main thread

D

The app has no permissions

Q102

Q102 A Foreground Service crashes after a long time. What could be a likely cause?

A

The Service is running on a background thread

B

The notification was removed

C

The Service was stopped manually

D

The system terminated it to free resources

Q103

Q103 What is a Notification in Android?

A

A way to store data

B

A pop-up window

C

A message displayed outside of the app's UI

D

A background service

Q104

Q104 Which method is used to issue a notification in Android?

A

createNotification()

B

sendNotification()

C

notify()

D

buildNotification()

Q105

Q105 What is the purpose of Notification channels in Android?

A

To group notifications by category

B

To enable multiple notifications at once

C

To manage background tasks

D

To store user settings

Q106

Q106 Which Android version introduced Notification Channels?

A

Android Marshmallow

B

Android Oreo

C

Android Nougat

D

Android Pie

Q107

Q107 How do you create a notification in Android?

A

NotificationCompat.Builder(context)

B

Notification.create()

C

Notification.new(context)

D

Notification.Builder(context)

Q108

Q108 How do you set a sound for a notification in Android?

A

notification.sound("file");

B

builder.setSound(uri);

C

builder.addSound(uri);

D

notification.setAudio(uri);

Q109

Q109 How do you create an action button in a notification?

A

builder.addAction(icon, title, pendingIntent);

B

builder.addButton(icon, title, pendingIntent);

C

builder.setButton(icon, title, intent);

D

notification.addAction(icon, title, pendingIntent);

Q110

Q110 A notification is not appearing in the status bar. What is the most likely reason?

A

The notification does not have a channel (Android 8.0 and above)

B

The app is in the background

C

The app has no internet connection

D

The device is in airplane mode

Q111

Q111 A notification sound is not playing when a new notification is received. What is a likely cause?

A

The app is not running

B

The sound file is corrupted

C

The notification settings are muted

D

The sound file is too large

Q112

Q112 What is a Fragment in Android?

A

A background service

B

A UI component that can be reused in multiple activities

C

A database handler

D

An asynchronous task

Q113

Q113 How does a Fragment communicate with its parent Activity in Android?

A

Through Intents

B

Through a direct method call

C

Through a Broadcast Receiver

D

Through interfaces

Q114

Q114 When should you use a Fragment instead of an Activity?

A

When you need an independent screen

B

When the UI needs to be dynamic and reusable within an activity

C

When you need background processing

D

When you need complex UI management

Q115

Q115 Which method is called when a Fragment is added to an activity?

A

onCreate()

B

onAttach()

C

onAdd()

D

onInflate()

Q116

Q116 How do you add a Fragment to an activity in Android?

A

Using startFragment()

B

Using FragmentTransaction.add()

C

Using Fragment.add()

D

Using startFragmentTransaction()

Q117

Q117 How do you replace an existing Fragment with another Fragment?

A

fragment.replace()

B

FragmentTransaction.replace()

C

FragmentManager.switch()

D

FragmentTransaction.switch()

Q118

Q118 A Fragment does not appear in the activity after adding it. What could be the most likely cause?

A

The Fragment is not declared in the manifest

B

The Fragment is not added to the layout file

C

The Fragment is not attached to the activity

D

The Fragment is not visible

Q119

Q119 An app crashes when trying to access a Fragment's UI component. What could be a likely cause?

A

The Fragment is not attached to the activity

B

The Fragment's view hierarchy is not initialized

C

The Fragment has no UI

D

The Fragment is null

Q120

Q120 What is the primary purpose of Android's permission system?

A

To ensure user privacy and security

B

To manage background services

C

To handle app updates

D

To improve app performance

ad verticalad vertical
ad