Android

Background Work

Services, WorkManager, BroadcastReceiver, AlarmManager, Foreground Service and background work management

18 câu hỏi phỏng vấn·
Mid-Level
1

What is a Service in Android?

Câu trả lời

A Service is an Android component that runs in the background without a user interface. It allows performing long-running operations like downloading files or playing music. It must be declared in the Manifest.

2

What is the difference between a Started Service and a Bound Service?

Câu trả lời

A Started Service is launched with startService() and continues running in the background independently of the component that started it. A Bound Service is connected to one or more components via bindService(), and stops automatically when all clients unbind. A service can be both Started and Bound.

3

How to start a Started Service?

Câu trả lời

Use startService(Intent) or startForegroundService(Intent) for Android 8+. The service receives onStartCommand() and continues running. It must stop itself with stopSelf() or be stopped with stopService().

4

What is a Foreground Service?

5

How to create a Foreground Service?

+15 câu hỏi phỏng vấn

Nắm vững Android cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí