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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:25:51+00:00 2026-05-18T10:25:51+00:00

I have an app that goes out to a website to grab XML for

  • 0

I have an app that goes out to a website to grab XML for processing. This process is in a separate thread and works fine when I have 3G or WiFi available. I also have code that checks signal before actually running the thread so it won’t attempt with no connectivity.

During my testing, I walked into a building that blocked all signal so the process started while I was outside and had signal but when I went inside the signal dropped and my Progress dialog just kept running, I had to manually shut the program down to get it to recover.

Is there a good way to deal with this without requiring the user to manually shut down the app if this situation happens?

  • 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-18T10:25:51+00:00Added an answer on May 18, 2026 at 10:25 am

    Supply timeout parameters to your HttpClientand catch SocketTimeOutException

    HttpParams httpParams=new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(httpParams, 5000);
    HttpConnectionParams.setSoTimeout(httpParams, 5000);
    HttpClient httpClient=new DefaultHttpClient(httpParams);
    try {
        httpClient.execute(new HttpGet("http://myserver.xml"));
    }
        catch(SocketTimeoutException ex){
            //Perform Timeout i.e. cancle progress dialog
        }
        catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a thread running in a service of an app that reads out
In my app I have a certain control flow that goes like this: DAO
I have a iPhone app that I'm working on and it works alot like
I have a Rails app that acts as a pass-through for an XML services
I have a rails app that I have serving up XML on an infrequent
So, I have a website that is served by 12 separate application servers without
I have an app that is running fine in the iPhone simulator by way
I have an app that works correctly on Android and iOS, but currently fails
I have a mobile app that populates a list. This takes a couple of
I have a game app that has the ability to go fullscreen and back

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.