Service vs IntentService in the Android platform

后端 未结 11 753
挽巷
挽巷 2020-11-22 03:38

I am seeking an example of something that can be done with an IntentService that cannot be done with a Service (and vice-versa)?

I also bel

11条回答
  •  孤城傲影
    2020-11-22 03:55

    I'm sure you can find an extensive list of differences by simply googling something such as 'Android IntentService vs Service'

    One of the more important differences per example is that IntentService ends itself once it's done.

    Some examples (quickly made up) could be;

    IntentService: If you want to download a bunch of images at the start of opening your app. It's a one-time process and can clean itself up once everything is downloaded.

    Service: A Service which will constantly be used to communicate between your app and back-end with web API calls. Even if it is finished with its current task, you still want it to be around a few minutes later, for more communication.

提交回复
热议问题