Android Studio – 35 – Services and Background Tasks MCQ

Android Studio – 35 – Services and Background Tasks

1 / 26

1. What is a Service in Android?

2 / 26

2. What is the primary purpose of using a Service?

3 / 26

3. Which component is suitable for long-running background tasks?

4 / 26

4. What is the advantage of using a Service over other components for background tasks?

5 / 26

5. How can you start a Service in Android?

6 / 26

6. What happens when you start a Service in Android?

7 / 26

7. How can you bind to a Service in Android?

8 / 26

8. What is the purpose of binding to a Service?

9 / 26

9. How can a bound Service communicate with its clients?

10 / 26

10. What is the lifecycle method of a Service that is called when it’s first created?

11 / 26

11. What is the lifecycle method of a Service that is called when it’s started?

12 / 26

12. How can you stop a Service in Android?

13 / 26

13. What happens when you stop a Service in Android?

14 / 26

14. What is an IntentService in Android?

15 / 26

15. How does an IntentService differ from a regular Service?

16 / 26

16. What is a common use case for an IntentService?

17 / 26

17. What is the purpose of a BroadcastReceiver in Android?

18 / 26

18. How does a BroadcastReceiver work in Android?

19 / 26

19. What is the role of an IntentFilter in a BroadcastReceiver?

20 / 26

20. How can you dynamically register a BroadcastReceiver in Android?

21 / 26

21. What is the purpose of a foreground Service in Android?

22 / 26

22. How does a foreground Service differ from a regular Service?

23 / 26

23. What is the purpose of a persistent notification in a foreground Service?

24 / 26

24. How can you start a Service in the foreground in Android?

25 / 26

25. What is the purpose of “onHandleIntent()” in an IntentService?

26 / 26

26. What is the recommended approach for performing background tasks in modern Android apps?

Your score is

0%