I have an application that gets data(json) from my webservice(rest). I can successfully get my json. What i did is this:
try{
DefaultHttpClient httpClient = new DefaultHttpClient();
httpClient.setCredentialsProvider(credProvider);
HttpGet httpGet = new HttpGet(url);
HttpResponse httpResponse = httpClient.execute(httpGet);
HttpEntity httpEntity = httpResponse.getEntity();
inStream = httpEntity.getContent();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try{
BufferedReader reader = new BufferedReader(new InputStreamReader(inStream));
StringBuilder sb = new StringBuilder();
String line = null;
while((line = reader.readLine()) != null){
sb.append(line);
}
inStream.close();
json = sb.toString();
}catch(Exception e){
logs...
}
// and so on...
But when i try to print my json (String)
, since I have a url got from that json...
my url looks like this something\/image\/myimage.png
insted of something/image/myimage.png
My problem where and how can i remove the additional "\"in my url. Is this an escape character?
Any ideas? It would be great if you share some. Though I'm currently also looking for a fix. But as of now, I can hardly find it.