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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:36:18+00:00 2026-06-03T15:36:18+00:00

We have a network client application, and we are trying to validate our approach

  • 0

We have a network client application, and we are trying to validate our approach to processing responses from the server in conjunction with device rotation. essentially, we do this,

  1. activity registers a receiver for network responses
  2. activity initiates a network operation by starting an intent service
  3. service responds by broadcasting an intent it’s finished

our (perceived) problem is that when the device is rotated, the activity is destroyed / recreated. during the time between when the activity’s receiver is unregistered in onPause() and when it’s re-registered in onResume(), we may have missed the intent that is broadcast by the service.

is this a real problem?

if so, we have hypothesized the following solution,

  1. first, don’t use intents to communicate between activity and service
  2. create two blocking queues: network requests and responses in say the application class
  3. service starts a thread that take()‘s from the request queue
  4. activity starts a thread that take()‘s from the response queue
  5. activity offer()‘s to the request queue when it wants to start a network operation
  6. service offer()‘s to the response queue when post the result of a network operation
  • 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-03T15:36:20+00:00Added an answer on June 3, 2026 at 3:36 pm

    Yes this can happen in rare circumstances but it will happens for sure if the user receives a call. Again your activity will be paused and then resumed, If the user talks for a long time your activity will loose a bunch of broadcasts from the service.

    My advice is that you must not use broadcasts to do two way communications between application’s in situations that a response from a component such as a service, requires immediate attention. What mechanism you will use is depending from the situation. In my latest project I am using a service in order to update an app-widget, in this scenario I am using static code in the service in order to do some queries or to request some actions.

    Your thinking sounds good but it may hides a complex implementation, If I was in your position I would consider to use the built in service mechanism called Bound Services. I have not used it so far but it seems that it is covering your needs.

    EDIT

    So based on the bound services concept I propose the following flow:

    1. Activity starts, a so called, sticky service.
    2. Service registers the receiver for network responces.
    3. Service maintains an Ibinder object with the needed information based on the network responces.
    4. Activity bounds to the service whenever it wants and retrieve the Ibinder object with the info and does the required actions.
    5. When it’s time to end the application, Activity stops the service and finishes itself.

    Hope this helps…

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

Sidebar

Related Questions

I have a adaptive server anywhere network server(version 7.0),it's name is TestServer. Now, Client
I have a client and a server that I'm trying to get to speak
I have some simple questions, I have a client-server application and data sent on
I have a client/server application that runs on an intranet, and I have the
I'm a hobby programmer trying to build a client/server application suite, using Delphi XE.
Due to our clients authentication and network topology we have a number of Windows
I'm designing an application which will have a network interface for feeding out large
I have a complex network of objects being spawned from a sqlite database using
I am developing a small client / server application in C. At the moment
I am trying to call HTTP request with network credential in blackberry. i have

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.