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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:30:53+00:00 2026-05-15T23:30:53+00:00

We have a Service that continuously collects sensor data on the phone. This service

  • 0

We have a Service that continuously collects sensor data on the phone. This service should run “forever”, e.g. as long as the user wants, and not be killed by the system.

For clarification, this service is not intended for an app to be released in the market to the general public, it is written for a scientific study. So the people running the app are fully aware that their battery will sucked empty faster than usual, this is no problem.

Anyways, my problem is that the service gets killed after a while of running. Sometimes after an hour, sometimes only after like 7 oder 10 hours.

The Log-Entries when the service gets killed look like this. It just says “no longer want“, sometimes without even calling onDestroy(), as far as I can tell.

07-20 17:07:11.593 I/ActivityManager(   85): No longer want my.project.datalogging (pid 23918): hidden #16
07-20 17:07:11.593 I/WindowManager(   85): WIN DEATH: Window{44c61570 my.project.datalogging/my.project.datalogging.DataLoggingApp paused=false}
07-20 17:07:11.603 I/BackgroundService(23925): onDestroy()

Or later (after I manually restarted it):

07-20 19:00:49.677 I/ActivityManager(   85): No longer want my.project.datalogging:BackgroundService (pid 24421): hidden #17
07-20 19:00:49.677 I/ActivityManager(   85): No longer want my.project.datalogging (pid 24415): hidden #18
07-20 19:00:49.807    85 10707 I WindowManager: WIN DEATH: Window{44f1ea58 my.project.datalogging/my.project.datalogging.DataLoggingApp paused=false}

I often see other services being killed with “no longer want” and then immediately restarted with “Scheduling restart of crashed service“. For example here with runkeeper:

07-20 17:30:45.503 I/ActivityManager(   85): No longer want com.fitnesskeeper.runkeeper (pid 24090): hidden #16
07-20 17:30:45.603 W/ActivityManager(   85): Scheduling restart of crashed service com.fitnesskeeper.runkeeper/.services.RunKeeperService in 5000ms
07-20 17:33:52.989 I/ActivityManager(   85): Start proc com.fitnesskeeper.runkeeper for service com.fitnesskeeper.runkeeper/.services.RunKeeperService: pid=24292 uid=10099 gids={3003, 1015}

The logs show no record of low memory. Testing is done on (several) Nexus One with 2.2 (Froyo FRF91).

Is there any way I can achieve this behaviour with my app? Automatic restarting after being killed?

Or this this something totally different that just looks similar in logcat?

If you need any more information, just ask and I’ll try to provide it 🙂

  • 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-15T23:30:53+00:00Added an answer on May 15, 2026 at 11:30 pm

    How do you start the service? Have you tried startForeground()? That’s not an absolute guarantee, of course, but should at least lengthen the lifespan.

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

Sidebar

Related Questions

I have a device that continuously collects data and stores it on a local
I have a service (with a wakelock) that must run continuously behind the scenes
We have an external service that continuously sends us data. For the sake of
I have a C# service that runs continuously with user credentials (i.e not as
We have a service that runs methods used for data import/export at specified intervals.
I have a long-lived server application that is designed to run with minimal downtime
I have a Windows service that continuously performs calculation tasks. There are multiple calculation
I have an application that takes days to process data. Is there a service
I have service that I need to run every 5 minutes. I already have
We have an unattended app w/o a user interface that is is periodically run.

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.