Forum

What is the difference between Service and IntentService? How are they used?

This thread contains 1 reply, has 2 voices, and was last updated by Nitesh User Do not delete 5 years, 2 months ago.

  • Author Replies
    • #52884

      What is the difference between Service and IntentService? How are they used?


    • #52885

      Service is the base class for Android services that can be extended to make any service. A class that quickly extends Service runs on the main thread so it will block the UI (if there is one) and should therefore either be used only for small tasks or should make use of other threads for longer tasks.

      IntentService is a subclass of Service that manages asynchronous requests (expressed as “Intents”) on demand. Clients send requests through startService(Intent) calls. The service is started as needed, handles each Intent, in turn, using a worker thread, and stops itself when it runs out of work. Writing an IntentService can be quite easy; just increase the IntentService class and override the onHandleIntent(Intent intent) method where you can manage all incoming requests.


      Regards,
      Nitesh Bavishiya

Viewing 1 reply thread

You must be to reply to this thread.Please or . Registration is 100% free.

GET FREE CONSULTATION

Call Us Now For Free Consultation97370 05566

Our experts listen to you patiently and suggest you the right course after conducting a personality profile test. Register your interest below to schedule personality profile test for you.

SUBSCRIBE TO OUR NEWSLETTER

Copyright 2016-2024 Smart Mentors. All Rights Reserved.

Login

FORGOT PASSWORD

Sign up now to Become An Instructor

    Register your Interest

      cf7captchaRegenerate Captcha