Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid httpclient request and processing with entity
    text
    copied!<p>I do requests to my servlet </p> <pre> try { Log.d(Constants.DEBUG_TAG_MAPS, "try"); HttpEntity entity = new StringEntity(json); post.setEntity(entity); HttpParams httpParameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParameters, 15000); HttpConnectionParams.setSoTimeout(httpParameters, 150000); httpclient = new DefaultHttpClient(httpParameters); BasicHttpResponse response = (BasicHttpResponse ) httpclient.execute(post); Log.d(Constants.DEBUG_TAG_MAPS, "http status code : "+response.getStatusLine().getStatusCode()); if(response.getStatusLine().getStatusCode() == 200){ Log.d(Constants.DEBUG_TAG_MAPS, "response 200"); HttpEntity responseEntity = response.getEntity(); if (responseEntity!= null) { Gson g = new Gson(); InputStream is = responseEntity.getContent(); InputStreamReader isr = new InputStreamReader(is); BufferedReader reader = new BufferedReader(isr); try{ responseEntity.getContent(); String x = EntityUtils.toString(responseEntity); }catch (Exception e) { // TODO: handle exception } responseJSONObject = g.fromJson(reader, JSONResponseObject.class); Log.d(Constants.DEBUG_TAG_MAPS_console, responseJSONObject.toString()); reader.close(); System.gc(); } } } catch (Exception e) { e.printStackTrace(); } /code></pre> <p>and on line : </p> <p>InputStream is = responseEntity.getContent();</p> <p>app is crashing ...response code is 200 ... I have looked on my tomcat logs and everything is ok. JSONResponseObject is filled with values and sended. </p> <p>What could be the problem? How can I get stacktrace to logcat?</p> <p>One maybe related problem: I have well know "Couldn't et connection factory client" in logcat Any of thing could causing that issue is not my case</p> <ol> <li>api key is correct, path to correct debug.keystore</li> <li>all permissions in manifest</li> <li>uses-library android:name="com.google.android.maps in manifest as well</li> </ol> <p>Map is displayed correctly, refreshing on zooming/moving. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload