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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:39:10+00:00 2026-05-21T16:39:10+00:00

I am writing an android app using the GPS location provider in a Service

  • 0

I am writing an android app using the GPS location provider in a Service that is started when the main Activity is created (unless the service is already running). I was under the impression that the service would continue to run with the unlikely exception that the task manager could killed it if there was a memory shortage. For some reason the service is restarted if there is a period of very low activity regardless of how much memory is available. When the user is outside and the GPS is able to resolve a position, the service will get a position every 30 seconds and turn off the gps in between (to save battery). In this case the service continues to run without any problems but when a user moves inside and a gps position can’t be found within five seconds, then the service turns off the gps and will only reactivate the GPS every 200 seconds to check if the user has moved back outdoors. In this case the service will sometimes be stopped and won’t be restarted until the app is reopened and the activity restarts the service. I created a separate service to make sure the process was uninterrupted. Does anyone know why this might be happening? Thanks so much for your help! -Dom

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

    I would have a look at Mark Murphy’s example that deals with Services and Wakelocks:

    WakefulIntentService

    If you can’t figure it out from his code example, then you want to get his Advanced Android book where the problem is explained in detail.

    The Busy Coder’s Guide to Advanced Android Development

    These are some of the best books on Android development and well worth the minimal cost.

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

Sidebar

Related Questions

I am writing an app for Android that will measure speed as the Android
I am writing a native iPhone and Android app using Sencha Touch inside Phonegap
I am writing an Android app that talks to a Google App Engine server.
I am writing an Android app in which I have a Map activity where
I'm writing a web and Android app that allows users to store and access
I am writing an android app and testing in on my own phone. It's
I am writing an android app and at some point I need to send
I'm writing an Android app to record and save high-rate accelerometer data (and later
I'm using Android to read a document off the net, surprise I'm writing here

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.