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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:42:14+00:00 2026-05-19T17:42:14+00:00

I am working on an application that runs a service. This service starts automatically

  • 0

I am working on an application that runs a service. This service starts automatically when the system boots or the app is started. My manager asked me to check if it is still running periodically (eg. every 5 minutes) or each time the screen is turned off and then start the service again if not running.

The closest solution I found was this:
http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/

This restarts the service only if the application is still running, which is unlikely if the user stopped it or killed it with some task manager.

Is it possible to have the service restarted other than boot-up or activity registered receiver? (Thinking about it as a User, I would not really like to have an application running all the time weather I wanted it or not.)

  • 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-19T17:42:15+00:00Added an answer on May 19, 2026 at 5:42 pm

    Why do you need a watchdog on the service? If it’s to prevent Android from recycling it to reclaim user resources, consider using the startForeground() method as discussed in this question: this requires you to have a notification icon for your service, providing an indication to the user. Listen to your own objection: avoid sneakiness towards the users!

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

Sidebar

Related Questions

I am working on an iPhone application that runs in portrait mode only. This
I'm working on an application that contains some buttons defined via layout.xml like this
I'm working with a flash application that runs as a standalone executable by way
I have an application that runs in fullscreen mode and has been working fine.
I'm working on a web application that runs with ASP.Net 3.5 Somewhere in the
I am working on a project that involves an embedded system which runs a
I have a windows service that runs various system monitoring operations. However, when running
Background: I'm working on an application that already has a thread system designed. It's
We currently have an automated system that runs as a service for processing satellite
I have recently started working on a legacy application that has most of its

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.