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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:05:15+00:00 2026-05-15T13:05:15+00:00

To be able to write nice code between my application/activies and a local service

  • 0

To be able to write “nice” code between my application/activies and a local service I need to understand some basic Android concepts:

What I’m wondering is if my application (as in my activities) and my local service is sharing one thread. I.e. when the activities and the local service executes tasks queued are these tasks interleaved in ONE thread thus sharing the thread or does the service has a thread of its own?

Also if the local service shares the thread with the activities and the local service makes a direct call (via a callback) to one of the activities (i.e. no post message) is the activity thread “halted” or is the execution of that specific function queued to be executed later anyway?

/ Henrik

  • 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-15T13:05:15+00:00Added an answer on May 15, 2026 at 1:05 pm

    Via Application Fundamentals:

    Like activities and the other components, services run in the main thread of the application process. So that they won’t block other components or the user interface, they often spawn another thread for time-consuming tasks (like music playback). See Processes and Threads, later.

    Now if the service is a separate application that is a different story..
    also from Application Fundamentals:

    In many ways, each Android application lives in its own world:

    • By default, every application runs in its own Linux process….
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was able to write some code with the help of the community here,
Users will be able to write some documents. Those documents will consists of chapters
I need to be able to write a script to automatically connect mysql in
By using Google I have found some nice snippets of example code for using
Before 2.1 I was able to write code like this (using the AddWhere): Query
I'd like to write some code which looks at a website and its assets
I have some Code that I'd like to share between an iOS and an
I'm envisioning a program I will need to write and need some advice on
I am able to write a data frame to an excel file, using the
It is able to write {{ myval.add:5 }} , {{ myval|add:value }} and even

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.