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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:09:42+00:00 2026-05-28T22:09:42+00:00

I need your thoughts. What I’m looking for is a task or service, running

  • 0

I need your thoughts. What I’m looking for is a task or service, running in the background (no UI), capable of the following:

  • it should not run permanently, only when it gets called. There are exactly two possible callers:
    1. a gui/touch application. Users can enter data and the application passes this data to the background service where the data gets persistet. This can happen at any time, randomly
    2. the Android OS, periodically. Maybe the AlarmManager is a suitable approach. When the service gets called periodically (e.g. each 30 seconds), it should process the data that was stored in step 1. When the processing is finished, it should stop itself to save battery.

In other words:
The user does not trigger the processing, the user is just responsible for the input. The AlarmManager then triggers the processing periodically.

Is the android service class suitable for that or is there a better way to go?

If yes, I have a problem understanding the service class. According to the docs, it does not have its own process but runs in the host process. Could this lead to problems? So sometimes the phonegap plugin (which passes the data) is the host process and sometimes the alarm code is the host process, or I am wrong? I mean the service has no main application, it is rather something independent that can be called from different locations.

Thanks

Thank you

  • 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-28T22:09:43+00:00Added an answer on May 28, 2026 at 10:09 pm

    A service would be appropriate here.

    You can schedule AlarmManager to call your Service at intervals and have your UI Activity push data to it and optionally wake the service up to process the data.

    A Service runs in the host process and will run in the UI thread unless you create another thread.
    The IntentService class can help you with this.
    It allows you to fire intents off that get handled by the service in a worker thread.

    The intents are queued up in the IntentService class and are processed in turn by a single worker thread that is managed by IntentService.

    In your case, you can have the AlarmManager fire off an Intent that would be handled by your service in the worker thread.

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

Sidebar

Related Questions

This is an subjective question, I need your feels and thoughts about coding standards,
So I need some advice and insight here. Thanks in advance for your thoughts.
I need your expertise once again. I have a java class that searches a
I need your help, For example I have a decimal type variable and I
I need your help to define a special case in XML schema: A sequence
I need your advice about framework selection (Java vs Mono) for a new large
I need your advice on this piece of code: the table fields options[0], options[1]
I really need your help in my issue very quickly and it's too close
I really need your help for this. I am relatively new to programming and
I'm completely stuck and need your help... I've created a webservice stub with jaxb

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.