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

  • Home
  • SEARCH
  • 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 6586423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:47:20+00:00 2026-05-25T16:47:20+00:00

In the https://github.com/commonsguy/cwac-wakeful demo, the OnAlarmReceiver (a BroadcastReceiver) onReceive() method is called in response

  • 0

In the https://github.com/commonsguy/cwac-wakeful demo, the OnAlarmReceiver (a BroadcastReceiver) onReceive() method is called in response to an Alarm. The onReceive() method starts the Service. There are two Intents used, one received by the BroadcastReceiver and one by the Service. This seems more complicated that it needs to be, why not just have the Service receive the Intent from the AlamManager?

I understand that the Phone is guaranteed not to sleep while onReceive() is executing i.e. it wrapped with a wake lock. I’m not sure if the Service class offers any similar guarantees.

Is the any way to start the Service directly from an Alarm while still guaranteeing that the Phone will be woken from sleep and won’t sleep until a wake lock can be acquired?

  • 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-05-25T16:47:21+00:00Added an answer on May 25, 2026 at 4:47 pm

    This seems more complicated that it needs to be, why not just have the Service receive the Intent from the AlamManager?

    Because Android will not guarantee that the device will stay awake long enough for a getService() PendingIntent to be invoked. The guarantee is only for a getBroadcast() PendingIntent — Android ensures that the device will stay awake (via a WakeLock) for the duration of your onReceive() call.

    Trust me, I wish we could skip it.

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

Sidebar

Related Questions

I'm trying to use the TouchListView made available here: https://github.com/commonsguy/cwac-touchlist . It's an Android
Hi I'm using the TouchListView control from here: https://github.com/commonsguy/cwac-touchlist and I've added some buttons
I try to add the commonsware TouchListView library ( https://github.com/commonsguy/cwac-touchlist ) to my android
I'd really like to implement in my app the touchlist widget, provided here: https://github.com/commonsguy/cwac-touchlist
Im using the endless adapter http://github.com/commonsguy/cwac-endless however whenever i return false (because i dont
Look at https://github.com/rails/rails/commit/1408b942d9c2c131a1cdcab97f49d74ce84dae38 I thought mocking meant you can mock any method. Did not
I followed this tutorial: https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf However, I can't seem to set the path right.
I'm using clearance ( https://github.com/thoughtbot/clearance/wiki ) for authentication in my rails app. But I'm
I downloaded the JSON2.js from https://github.com/douglascrockford/JSON-js/blob/master/json2.js and it does not have implementation for JSON2.stringify()
The installation for clearance seems very straight forward ( https://github.com/thoughtbot/clearance ). I'm following in

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.