Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8574873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:34:23+00:00 2026-06-11T19:34:23+00:00

Since there is such a needed concern for an application’s battery usage, ram and

  • 0

Since there is such a needed concern for an application’s battery usage, ram and cpu usage, what is the expense of multiple contentobservers vs. multiple broadcastreceivers?

Example 1:

A service running with START_STICKY using 5 contentobservers
registered/unregistered properly.

Example 2:

A service being fired from 5 broadcastreceivers set in the manifest.

Example 3:

A service running with START_STICKY using 5 registered
broadcastreceivers.

What is the true difference in battery usage/ram/cpu between an observer and a receiver? Can any pros chime in on this? I’m assuming 1 instance wouldn’t make much of a difference, but lets take the above examples with 5 running at once.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:34:24+00:00Added an answer on June 11, 2026 at 7:34 pm

    Service running vs no Service running

    Each app has at least one Process that is started when your app is running. That process uses at least some memory and people like to use task killers to free that although Android does that automatically once memory is actually required. This memory is definitely a disadvantage for the Service case.

    CPU / battery usage is only increased when something is happening and therefore actively using the CPU or when your app forces the system to keep resources enabled e.g. when you keep a WakeLock. If you don’t do any of this your app uses about 0 CPU / battery and acts pretty much like a stopped app that is kept in memory to speed up restarting it. The probability that you inadvertently use some resources is certainly higher if your code is running.

    If no Service / Activity is running at all and you just register a BroadcastReceiver in your manifest you basically tell the system to include your receiver in the list of receivers it checks when sending broadcasts. Very minimal extra work.

    Manifest receivers also have the advantage that the system can’t get killed when the memory pressure is high. Those receivers just work and you don’t need to care at all. You can even enable / disable them if you wish to do so.

    ContentObserver vs BroadcastReceiver

    Both should use the ActivityThread / Looper / MessageQueue mechanism usually refered to as the “UI Thread” which delivers all events to your app and calls all the onCreate, onTouch etc methods. Easily visible when you look at a stacktrace when something breaks in these methods:

    AndroidRuntime(521): FATAL EXCEPTION: main
    AndroidRuntime(521): java.lang.RuntimeException: MotionEvent{405215b0 action=0 x=66.0 y=78.0 pressure=1.0 size=0.0} recycled twice!
    AndroidRuntime(521):     at android.view.MotionEvent.recycle(MotionEvent.java:659)
    AndroidRuntime(521):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1880)
    AndroidRuntime(521):     at android.os.Handler.dispatchMessage(Handler.java:99)
    AndroidRuntime(521):     at android.os.Looper.loop(Looper.java:123)
    AndroidRuntime(521):     at android.app.ActivityThread.main(ActivityThread.java:3647)
    

    If no broadcast or content change notification is to be delivered that thread simply waits. Waiting does not use the CPU (i.e. actively cycle in a loop all the time) but tells the system that it does not need to schedule processing time for that thread. CPU usage is effectively ~0 in that time. So IMO there is no difference at all between registering one of the two at runtime.

    The only difference that could give advantages to one of the methods would be if one if the methods trigger more often.

    1 vs 5 of them

    Does not matter. There are so many receivers / observers in the system that it does not really matter if you add 1 or 5. If you add like 1000 you’ll probably notice

    On a sidenote: Don’t block the UI thread from doing it’s work. Although receivers and services don’t have UI their callback methods are executed on the UI thread. So if you do any long-running operation like downloading stuff in any of the onReceive / Service#onCreate etc methods that will lead to ANRs the same way it does e.g. in Activity#onCreate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since there is no way to join tables using Google App Engine datastore, I
Since there are no C# source codes for Wait, Pulse, PulseAll methods. Does anyone
Since there is no way that you can make the flash object transparent, there
Since there is no type in ruby, how do Ruby programmers make sure a
Edit Since there were many downvotes and people who didn't understand what I'm asking
I am trying to avoid using Net::SSH::Perl library since there is some problems in
I keep coming back to this problem, since there doesn't seem to be a
So my issue is pretty straight forward, since there is seemingly no callback for
When using ModelForm Within forms.py it would save a lot of time, since there
I'm guessing it's not a Perl Compatible Regular Expression, since there's a special kind

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.