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 9260201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:50:01+00:00 2026-06-18T12:50:01+00:00

For instance, I need a BroadcastReceiver to get these events: REBOOT or SHUTDOWN SCREEN

  • 0

For instance, I need a BroadcastReceiver to get these events:

REBOOT or SHUTDOWN

SCREEN ON or OFF

battery status (voltage, plugged in, temperature)

physical button presses (camera, media, etc.)

But I need Listener to get these events:

EventListener for sensor events (acceleration,magnetic fields, orientation, proximity, temperature, light level, etc.)

LocationListener for location events (Network location, GPS)

It seems like both Receivers and Listeners both exist so that I can receive events. Other than the obvious semantic differences, what are the difference between the two? Are there things I can do in one but not the other, especially in regards to things like how much CPU I can take and running while the screen is off? Why are there two totally different constructs for the purposes of receiving events?

  • 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-18T12:50:02+00:00Added an answer on June 18, 2026 at 12:50 pm

    There are so many differences between these two, them responding to something is one of the only similarities.

    Differences:

    • BroadcastReceivers receive Intents whereas a Listener can do basically anything, since it does not have a defined purpose, it’s just a naming convention. Eg, search for “BroadcastReceiver” on the dev website then search for “Listener”

    • BroadcastReceivers just receive an Intent Broadcast which is non-direct, Listeners get called explicitly.

    • A BroadcastReceiver is its own defined class since it has a definite purpose (receiving Intents) whereas Listeners can be anything – they’re usually an interface and they are provided so that callbacks can be made from one class to another.

    • BroadcastReceivers are usually used for global, system-wide events, Listeners for specific events (ie a Location sensor shouldn’t give location updates every second unless it has something, such as a Listener to publish to. Contrasted with a screen-off intent – this is important, it affects everything, and so should be broadcast to all interested Receivers)

    • Events a BroadcastReceiver picks up are usually non-continuous events (one shot), whereas Listeners, depending on what they do, can be used for constant updates (continuous).

    • BroadcastReceivers can be instantiated by the system if they’re declared in the manifest, Listeners are only dynamically made (so via code).

    • CPU/Power usage depends on implementation of both, especially since as mentioned, Listeners can be anything.

    Are there things I can do in one but not the other, especially in regards to things like how much CPU I can take and running while the screen is off?

    BroadcastReceivers only have 10 seconds of guaranteed execution time. Listeners, since they don’t serve a specific purpose, don’t have this limit.

    What you definitely can’t do from a BroadcastReceiver:

    In particular, you may not show a dialog or bind to a service from
    within a BroadcastReceiver.

    There are probably more – this is what I came up with.

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

Sidebar

Related Questions

I need to get an instance of the application's MembershipProvider from within a controller.
I need to get an unique id of an android activity instance. I'd like
I need to create a new DB2 instance and import a database from the
I need to connect to a MongoDB instance from my EJB3 application, running on
I need to replace every instance of any text in square brackets with something
I need to write a function that is passed an instance of a CharField.
I need this roadmap of a Hibernate managed object instance. First, I create an
I need to import a database into a SQL Server instance using a batch
I need to serialize a Lucene.net Document instance. When I try the following public
I need to mock a GrailsControllerClass interface. Instance should have a static variable defined.

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.