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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:08:18+00:00 2026-05-27T02:08:18+00:00

I have an Android Service running in a separate process from its client, and

  • 0

I have an Android Service running in a separate process from its client, and is running only as long as the client is connected. I am wondering when exactly during its lifecycle does it accept requests from the client?

I am having problems with requests that are made early / late in the Service’s lifecycle. As far as I understand, each request is handled in a thread separate from the main Service thread. I have the following problems:

  • A request is handled by the Service before or during the Service.onCreate(). I have seen exceptions that are trying to use resources that are initialized in my Service.onCreate(), but these are null, and logging confirms that the main Service thread is in the onCreate().
  • A request is handled by the Service during or after the Service.onDestroy(). Again, exceptions and logging have confirmed that a thread is handling a request and trying to use resources that have been released in the onDestroy().

Is it possible for Android to allow requests to be made to a Service that isn’t completely initialized or destroyed?

  • 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-27T02:08:19+00:00Added an answer on May 27, 2026 at 2:08 am

    I have an Android Service running in a separate process from its client

    Please don’t do this, unless these processes represent separate apps.

    I am wondering when exactly during its lifecycle does it accept requests from the client?

    “Request” is a meaningless term. I am assuming that by “request” you mean “call a method exposed by the Binder published by the service”.

    As far as I understand, each request is handled in a thread separate from the main Service thread.

    Calls made to methods exposed by the Binder are called on threads from a thread pool, separate from the main application thread. It’s one of the few places in Android where Android calls your code from a separate thread.

    A request is handled by the Service before or during the Service.onCreate().

    This should be impossible, as onBind() will not have been called yet, so there is no Binder. Nothing can make a “request” yet.

    A request is handled by the Service during or after the Service.onDestroy()

    I can’t rule out this possibility. I would have thought that Android would have torn down the IPC interface before onDestroy() is called.

    which is why I’d like to know at which point in the lifecycle the service is considered “available”.

    It is “available” when the client’s ServiceConnection is called with onServiceConnected(). This will occur after onCreate() and onBind() if the service did not already exist.

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

Sidebar

Related Questions

I have a self-hosted WCF web service running, and an Android client application. I
I have a service running in its own process. It appears fine in the
I have a simple client-server app on android. the android service communicates with the
I currently have a Service in Android that is a sample VOIP client so
I'm testing an android application with a long running service. I'm using Eclipse and
I have an Android app, in which Activities fire long running operations that run
Hello I have an android application which has a service running. After 20 mins
I have a service running in my Android application which contains a HashMap that
I have an Android app with a running service. When I look in the
I have a service running, and one of its tasks is to regularly fetch

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.