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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:59:38+00:00 2026-05-27T12:59:38+00:00

My application is currently using ordinary threads to produce servers, clients and even a

  • 0

My application is currently using ordinary threads to produce servers, clients and even a thread which swaps WiFi networks and starts the previous. Those threads run in the background and dont have any impact on the UI so it is something I was looking for, but the problem is that when I reenter the application all those threads are recreated. Is it possible to create a singleton thread which will be possible to control when we reopen the application?

Android offers some classes also:

Service: but it uses the UI thread…

AsyncTask: probably a better candidate

IntentService: has a worker thread which could be manipulated? Probably best option from above.

Any thoughts/opinions will be highly appreciated. 🙂

EDIT:

Also why I would want to change my ordinary threads into some other method is because Android will prioritize ordinary threads to get killed.

Thread call hierarchy:

MainActivity -> NetworkSwap(infinite process which is scanning, connecting and swaping WiFi networks), ServerTCP(infinitely listening for connections) , ServerUDP(infininetely listening for connections)

Networkswap -> ClientUDP (sends broadcast request to serverUDP and ends)

ServerUDP -> ClientTCP (sends request to serverTCP and ends)

  • 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-27T12:59:39+00:00Added an answer on May 27, 2026 at 12:59 pm

    It’s still not entirely clear to me what you’re using these threads for. From the title it seems you’re doing ongoing work, but in the description it sounds like sometimes you do smaller discrete chunks of work. It’s also not clear whether these types of work are related.

    That said, with ongoing work I’d say to move your currently existing thread to be managed by a regular Service, thus giving a lifetime that is independent of activities and can do ongoing background work. For smaller discrete chunks of work, IntentService is a better match. If you have these two types of work and they’re not very related, you could even consider having both types of services (it sounds like you have multiple threads as is anyway).

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

Sidebar

Related Questions

I have an application in which I'm currently using a two column table in
I'm currently using Unity with Unity.Mvc3 in my MVC3 application which uses Windows Authentication.
I'm currently using an application in python which works quite well but when I'm
I have an application currently using the 1.0 version of ent-lib, which I am
I have an application which is currently using and storing data in Core Data.
I have a legacy application which is (currently) using Django to effectively display data.
We are currently using Kohana 3 for a staging application which is getting ready
We are currently using ASIHTTPRequest in our iPad application, which is a PDF viewer.
I have an application which is currently using the google map API. I like
My Flash (AS3/AIR) application is currently using a slightly unusual architecture (for a Flash

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.