Skip to content
tezvyn:

Started vs. Bound Services: Differences and Use Cases

Source: developer.android.comEasyHow cards are made

Started vs. Bound Services: Differences and Use Cases

Tests your grasp of Android component lifecycles. A strong answer defines each by its lifecycle control (who starts/stops it) and communication pattern (fire-and-forget vs. client-server), then gives distinct use cases.

What's really being asked

This question tests your understanding of Android component lifecycles, resource management, and choosing the right tool for a background task. The interviewer wants to see if you can articulate how a Service's lifecycle is managed, how it communicates with other components, and when it's appropriate to use one over the other, or over modern alternatives like WorkManager.

The full answer

A strong answer clearly distinguishes the two across three axes. First, LIFECYCLE: A Started Service runs independently of the component that started it and must manage its own lifecycle, typically with stopSelf(). A Bound Service's lifecycle is tied to the components bound to it; it's destroyed when the last client unbinds. Second, COMMUNICATION: A Started Service is for one-way, fire-and-forget operations initiated via startService() with an Intent. A Bound Service is for two-way, client-server interaction using bindService(), which provides a persistent IBinder interface for method calls. Third, USE CASE: Use a Started Service for operations that should complete without a UI, like syncing data or uploading a file. Use a Bound Service when a client (like an Activity) needs to actively interact with an ongoing process, like a music player (play, pause, skip) or a live location tracking service.

The mistakes people make

A major red flag is being unable to explain the lifecycle difference. Simply saying "a bound service returns data" is incomplete; the key is the persistent, two-way connection and lifecycle dependency. Another weak answer gives poor use cases, like using a Bound Service for a simple network request that a coroutine could handle. A top-tier candidate might also mention that for many deferrable tasks, WorkManager is now the recommended solution over a Started Service, showing awareness of modern Android practices since API 26.

What usually comes next

"When would you use a Foreground Service?" (When a service performs a user-noticeable task, like music playback, requiring a persistent notification). "How does a Bound Service handle multiple clients?" (A single Service instance is created; it handles connections from multiple clients, returning the same IBinder to each). "What is AIDL and when would you use it?" (For IPC between different applications, not just components within the same app).

A concrete example

A Started Service is ideal for a one-time operation like uploading a user's new profile picture to a server. The Activity calls startService() with the image URI and can then be destroyed. The Service runs in the background, performs the upload, and calls stopSelf() when done. A Bound Service is perfect for a media playback app. The MusicPlayerService holds the MediaPlayer instance. The UI Activity binds to this service to call methods like play(), pause(), and getTrackDuration(). When the user leaves the UI, the Activity can unbind, but the service can continue playing music if it was also started and promoted to a foreground service.

Interview question

What is the primary distinction in lifecycle management between an Android Started Service and a Bound Service?

  • a.A Started Service runs independently and must call stopSelf() to terminate, while a Bound Service's lifecycle is governed by its bound clients.Correct
  • b.Both service types are automatically destroyed by the system once all background tasks are completed.
  • c.A Started Service is destroyed when its initiating component is destroyed, while a Bound Service continues until explicitly stopped.
  • d.A Bound Service manages its own lifecycle independently, whereas a Started Service's lifecycle is tied to its bound clients.
Why?

A Started Service runs independently of its calling component and must explicitly stop itself using stopSelf(), whereas a Bound Service's lifecycle is directly tied to its bound clients, being destroyed when the last client unbinds. Option C is incorrect because a Started Service continues running even if its starter is destroyed.

Just read this? Test yourself on what you have been reading.

Read the original → developer.android.com

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on android — each one lists the topics its interview covers.

See open roles