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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:43:16+00:00 2026-05-24T03:43:16+00:00

I have an application in which there is Google map, location overlays on Google

  • 0

I have an application in which there is Google map, location overlays on Google map and a separate thread which send the current location of device to server after every 30 seconds. The problem is that when the thread sends the location to server the screen of device halted until the server respond. Here is the following code,

Global Object

private Handler handlerTimer = new Handler();

In onCreate Method

 handlerTimer.removeCallbacks(taskUpdateStuffOnDialog );
 handlerTimer.postDelayed(taskUpdateStuffOnDialog , 100);

And here is the taskUpdateStuffOnDialog

    private Runnable taskUpdateStuffOnDialog = new Runnable() 
    {        
        public void run() 
        { 
        try
        { 
        URL url3 = new URL("http://"+ appState.getURL()+"//iLocator/IDForClient.php?reg_no="+ Device_ID[0]);
        HttpURLConnection conn = (HttpURLConnection) url3.openConnection();
        BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String quote = reader.readLine();
        while (quote != null)
        {
            Device_ID = quote.split("\n");
            quote = reader.readLine();
            bCheckID = true;
        }//End While

        positionOverlay.setID(Device_ID[0]);
        addEvent(Device_ID[0]);

    }//End try
    catch (Exception e) 
    {
        e.printStackTrace();
        Toast.makeText(MainMapActivity.this, "Communication Issue",Toast.LENGTH_LONG).show();       
    }//End catch
handlerTimer.postDelayed(this, 9000);
        }

    };

Please tell me what is wrong with my code.

  • 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-24T03:43:16+00:00Added an answer on May 24, 2026 at 3:43 am

    The problem is that, although you’re spawning a new Thread, you aren’t spawning a new process. Everything you’re doing is still in the user interface process, and that’s blocking. You can find more information on the topic on developer.android.com.

    The quickest and easiest way to get around this is using the IntentService class. It will only allow one HTTP request to be executed at a time, but will take care of all the problems for you.

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

Sidebar

Related Questions

I have an application which requires plotting two locations on google map ? One
I have an application in which there is a form which I want to
I have an application which displays properties dialogs for various GUI-accessible objects. Because there
I have a .NET 2005 (C#) desktop application, in which there is a login
I have made a swings application but there is one problem in that which
I have a three-tier application which is installed in corporate environments. With every server
I have a Winsock based server application which uses Windows Winsock I/O Completion Ports.
We have ASP.NET MVC 3 application which is integrated with Google Checkout API .
I have an application which needs to load data from a remote server (businesses
I am working on a HTML5 application designed to run a Google map which

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.