Download Latest Software's and Books about Developers topic

by xexna » Thu, 04 Feb 2010 05:49:59 GMT

Sponsored Links
 Download latest softwares's and Books for free just visit 


Other Threads

1. Multi-threaded http requests cause exception

I have an app making an https post on one thread while performing a
file download on another thread.  For some odd reason, I am getting a
ClientProtocolException saying that "The server failed to respond with
a valid HTTP response".  The error goes away if everything is run on a
separate thread.

Oddly if I run the two server requests in serial, the error goes
away.  It seems there's a bug that happens when two requests are made
at the same time.

Important note:  The post occurs to a different server than the
download so the servers themselves should not be causing the problem.

The code is simple.  Here's the file download code:

HttpGet httpGet = new HttpGet(url);
HttpClient client = new DefaultHttpClient();
HttpParams params = client.getParams();
HttpConnectionParams.setConnectionTimeout(params, 15000);
HttpResponse httpResponse = client.execute(httpGet);
HttpEntity responseEntity = httpResponse.getEntity();
byte[] data = EntityUtils.toByteArray(responseEntity);

The post code's the same except for these additional lines:

HttpPut httpPut = new HttpPut(url);
httpPut.addHeader("Content-Type", "text/xml");
httpPut.setEntity(new StringEntity(postData, "UTF-8"));
BasicHttpParams parameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(parameters, 15000);
HttpClient client = new DefaultHttpClient();
HttpResponse httpResponse = client.execute(httpPut);
HttpEntity responseEntity = httpResponse.getEntity();
metaData = EntityUtils.toString(responseEntity);



2. Bluetooth connect socket timeout

I'm getting a connect timeout using Android as a bluetooth client
connecting to a server device.  I'm pretty sure the UUID is correct as
I no longer get the immediate service discovery errors that I got when
using any other UUID string.  So I have two questions:

1) Is it possible to lengthen the (about) 12 second timeout for the
socket connect?
2) Are there any other settings I need to be looking at to make this



3. Custom Adapter

4. EditText - maximum width

5. Dev Guide misunderstands static classes?

6. Service Context.stopSelf() does not work!

7. Anyone used mob4hire for testing?