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

  • Home
  • SEARCH
  • 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 9124321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:32:44+00:00 2026-06-17T06:32:44+00:00

I have an android application that binds itself to a remote service once the

  • 0

I have an android application that binds itself to a remote service once the application starts. The remote service provides an abstraction to a bluetooth video camera so we can send commands and receive events from it easily. The binding happens from the Application itself as opposed to an Activity. It is important to me that as long as the camera connection to bluetooth is active that my application stay running so I can receive events from the remote service. The main reason is that I need to know if it’s recording or not and if so I need to periodically send it GPS coordinates.

Will my application have a better chance of not being killed if I use a service within my own application to manage that? Or is my application safe from being killed since it is still bound to the remote service? Of course, I understand that the android system will kill my app if memory requirements require it to but will it ever kill my app just because it’s been sitting for awhile not doing much?

  • 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-06-17T06:32:45+00:00Added an answer on June 17, 2026 at 6:32 am

    The application’s process should only be removed if memory is low, but you will raise the perceived importance of your process if you use a service rather than an empty process or a background activity. You can also use startForeground() to make it less likely that Android will stop your service.

    From http://developer.android.com/reference/android/app/Activity.html#ProcessLifecycle:

    Process Lifecycle

    The Android system attempts to keep application process around for as
    long as possible, but eventually will need to remove old processes
    when memory runs low. As described in Activity Lifecycle, the decision
    about which process to remove is intimately tied to the state of the
    user’s interaction with it. In general, there are four states a
    process can be in based on the activities running in it, listed here
    in order of importance. The system will kill less important processes
    (the last ones) before it resorts to killing more important processes
    (the first ones).

    1. The foreground activity (the activity at the top of the screen that the user is currently interacting with) is considered the most
      important. Its process will only be killed as a last resort, if it
      uses more memory than is available on the device. Generally at this
      point the device has reached a memory paging state, so this is
      required in order to keep the user interface responsive.
    2. A visible activity (an activity that is visible to the user but not in the foreground, such as one sitting behind a foreground
      dialog) is considered extremely important and will not be killed
      unless that is required to keep the foreground activity running.
    3. A background activity (an activity that is not visible to the user and has been paused) is no longer critical, so the system may
      safely kill its process to reclaim memory for other foreground or
      visible processes. If its process needs to be killed, when the user
      navigates back to the activity (making it visible on the screen
      again), its onCreate(Bundle) method will be called with the
      savedInstanceState it had previously supplied in
      onSaveInstanceState(Bundle) so that it can restart itself in the same
      state as the user last left it.
    4. An empty process is one hosting no activities or other application components (such as Service or BroadcastReceiver classes).
      These are killed very quickly by the system as memory becomes low. For
      this reason, any background operation you do outside of an activity
      must be executed in the context of an activity BroadcastReceiver or
      Service to ensure that the system knows it needs to keep your process
      around.

    Sometimes an Activity may need to do a long-running operation that
    exists independently of the activity lifecycle itself. An example may
    be a camera application that allows you to upload a picture to a web
    site. The upload may take a long time, and the application should
    allow the user to leave the application will it is executing. To
    accomplish this, your Activity should start a Service in which the
    upload takes place. This allows the system to properly prioritize your
    process (considering it to be more important than other non-visible
    applications) for the duration of the upload, independent of whether
    the original activity is paused, stopped, or finished.

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

Sidebar

Related Questions

I have an Android application that is binding to a persistent service (once started
I have a Web Service and an Android application that uses this web service.
I have Android application that on Service start implement followed code: ... Process process
I have a service running in my Android application which contains a HashMap that
I have an android application that can take a photo from device's camera. The
i have this android application that requires to load data from a remote server
We have an android application that we're trying to use for web-service communication. We
I have an Android application that has a service that runs in the background,
I have an android application that launches a child Activity under certain situations. Both
I have an Android application that connects to Facebook to request authorization of an

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.