Im using above service to get response from the server and decode it to a string builder. But when i run the app it shows a warning
org.json.JSONException: Value  of type java.lang.String cannot be converted to JSONArray
in the log cat.
There is no problam with the server side.
protected String doInBackground(String... params) {
StringBuilder stringBuilder = new StringBuilder();
try{
HttpResponse response = null;
HttpParams httpParameters = new BasicHttpParams();
HttpClient client = new DefaultHttpClient(httpParameters);
JSONObject jobj = new JSONObject();
try {
jobj.put("page_id",pageID);
} catch (JSONException e) {
e.printStackTrace();
}
String url = "http://myservice.com/gustbook_berry/mobile/GetOrder";
Log.i("Send URL:", url);
// HttpGet request = new HttpGet(url);
HttpPost request = new HttpPost(url);
List<NameValuePair> page = new ArrayList<NameValuePair>(1);
page.add(new BasicNameValuePair("page_id", jobj.toString()));
Log.d(TAG, url + page);
request.setEntity(new UrlEncodedFormEntity(page));
response = client.execute(request);
HttpEntity entity = response.getEntity();
InputStream stream = entity.getContent();
//String output=EntityUtils.toString(response.getEntity(), HTTP.UTF_8);
//System.out.println("OUT PUT->>"+output);
int b;
while ((b = stream.read()) != -1) {
stringBuilder.append((char) b);
System.out.println(stringBuilder.toString()+"\n");
}
}catch(Exception e){
System.out.println(" error ocurres :" + e.getMessage());
}
return stringBuilder.toString();
}
Please help