I have two separate applications that run simultaneously. One is meant to post location coordinates to a SQL database as soon as the person's location changes. It accesses a php file which updates the database. The second application accesses the same php file and it also implements locationlistener. It looks like I may be receiving an ANR for one application as I open the other application though I never see an ANR window. I do see that the location coordinates are not posted to the database so I know there's something wrong.
I've read where there's a difference in the HTTPClient execute (one is syncrhonous and the other asynchronous). I switched to the asynchronous call (the same call is implemented in both apps - see code below) Can anyone tell me why this is failing? IE, why won't both apps run simultaneously? I noticed with the synchronous call, it works for about 5 minutes or so but then one app fails. It seems as though with the asynchronous call, the fail happens immediately.
String queryString = "http://linkto.php/plusparams
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(queryString);
// Create a response handler
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String responseBody = httpclient.execute(httppost, responseHandler);
// shut down the connection manager to ensure
// immediate deallocation of all system resources