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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:22:28+00:00 2026-06-08T16:22:28+00:00

Disclaimer: My app already working without any Wake Locks for 1+ year and all

  • 0

Disclaimer: My app already working without any Wake Locks for 1+ year and all is well for most devices.

I’m tracking GPS and it works like this:

  1. AlarmReceiver starts Service every 5/10/15 minutes (as user wishes)
  2. Service subscribes for Location updates and waits MAX 1 minute for good GPS.
  3. Wrap up, send data to server and shut down service.

Due to bad connections and bad locations – whole thing take up to 2-3 minutes sometimes. And it works. No matter if phone is sleeping or not.

Now I’m reading about WakeLock and it doesn’t make sense to me. How come my stuff is working? Is that coincidence?

  • 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-08T16:22:30+00:00Added an answer on June 8, 2026 at 4:22 pm

    How come my stuff is working?

    A combination of things, including a dollop of luck. 🙂

    First, as Joel noted, the device wakes up briefly courtesy of your alarm, but the OS is only guaranteed to hold a WakeLock for the duration of onReceive() of a BroadcastReceiver.

    It is possible that, at least on some versions of Android, requesting GPS updates causes the OS to acquire its own WakeLock. This is undocumented behavior AFAIK, and I have never relied upon it personally. If it does, though, and you are doing the rest of your work (“Wrap up, send data to server and shut down service”) before removing location updates, that would explain the behavior.

    There are still potential gaps in your approach (e.g., if you delegate to a Service to do the work and are not holding a WakeLock as part of passing control to that service). Statistically speaking, it may fail occasionally but work a lot of the time.

    Personally, I recommend using a WakeLock, in case the undocumented behavior changes. That’s what I do in LocationPoller.

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

Sidebar

Related Questions

Disclaimer, new to programming, working my way through C++ Prime Plus 6th ed. I'm
The Disclaimer First of all, I know this question (or close variations) have been
Disclaimer:It's my first time developing an app that will be on a tablet style
I have an app that shows a disclaimer at the beginning of the program.
Disclaimer : I am relatively unfamiliar with the flash build processes, so some/all of
I'm currently working on an iPhone app that requires the user to accept a
disclaimer: I must use a microsoft access database and I cannot connect my app
I have been searching all over but I can't find any answer to this.
I have this alert view (disclaimer) that pop up when app finish launching. It
Disclaimer: I'm fairly new to python! If I want all the lines of a

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.