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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:00:00+00:00 2026-05-29T10:00:00+00:00

I am working on a program which consists of two parts Service component will

  • 0

I am working on a program which consists of two parts

Service component will read various system features (CPU usage, RAM usage, Number of Running Tasks, Messages Sent, Calls Made etc) every pre determined time interval lets say 15 minutes. And save these readings/data in a database.

Activity component will read the data from SQL database file and process the information.

My Questions are

  1. What kind of service do I have to create that will stay alive forever until stopped by the activity it should also automatically restart after system reboot?

  2. Has anyone got an example of service writing data to database?

  3. Can I invoke the parent activity from the service?

  • 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-29T10:00:01+00:00Added an answer on May 29, 2026 at 10:00 am

    Sounds like a fairly standard Service. Read up on the Service lifecycle.

    Answers:

    1. Any service will do. You’ll need a BroadcastReceiver that listens for the BOOT_COMPLETED intent to start the service at boot.
    2. Service objects are Context objects, so you can do anything with a SQLite database that you could do from an Activity. No difference.
    3. Define “invoke” and “parent activity”. You can start an Activity from the service via the standard startActivity() method from Context. If you start the Service from the BroadcastReceiver at boot, it’s an independent service not connected to any Activity so there is no parent Activity.

    Note also that a Service may not be absolutely necessary for your stated intent. If you’re only doing things that infrequently, you may be able to get by with an AlarmManager alarm. That way you’re not leaving a Service running — and consuming resources — for something you’re only processing every 15 minutes.

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

Sidebar

Related Questions

I'm working on a program which uses the System.Diagnostics.Debugger.Break() method to allow the user
I'm working on a program which will generate some temporary files, wait for the
I have a program which consists of multiple projects in eclipse (working under ubuntu
I am working on a calendar program, which consists mainly of a WPF DataGrid
I am working on a program which logs memory usage on a server. The
I am working on a program which manipulates images of different sizes. Many of
I am working on a simple CAD program which uses OpenGL to handle on-screen
I am working on a Windows utility program which communicates with some custom hardware
Background I am working on a phonetic converter program which converts english text into
I am now working on a program for Android which is something related to

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.