org.json.JSONException:Value<;调试期间无法将java.lang.String类型的div转换为JSONObject 我开发了android应用程序,我的概念之一是通过android应用程序的用户评级 所有参数都必须通过ratelogin Asynchronous, 当我运行我的Android应用程序时,我在调试我的应用程序时遇到了异常,我在下面给出了我的异常,请任何人给出这个问题的解决方案..提前谢谢。 **我的例外是** >org.json.JSONException:Value
我认为您从服务器得到了错误的响应。如果调试应用程序,您会发现您的响应如下org.json.JSONException:Value<;调试期间无法将java.lang.String类型的div转换为JSONObject 我开发了android应用程序,我的概念之一是通过android应用程序的用户评级 所有参数都必须通过ratelogin Asynchronous, 当我运行我的Android应用程序时,我在调试我的应用程序时遇到了异常,我在下面给出了我的异常,请任何人给出这个问题的解决方案..提前谢谢。 **我的例外是** >org.json.JSONException:Value,java,android,json,jsonexception,Java,Android,Json,Jsonexception,我认为您从服务器得到了错误的响应。如果调试应用程序,您会发现您的响应如下 我也面临同样的问题。所以它的服务器错误不是android….任何人都给出了解决方案,谢谢。。 I develope android application ,one of my concept is pass user rating of an android application all are required paramter to pass ratelogin asynchronus , When i ru
我也面临同样的问题。所以它的服务器错误不是android….任何人都给出了解决方案,谢谢。。
I develope android application ,one of my concept is pass user rating of an android application
all are required paramter to pass ratelogin asynchronus ,
When i run my Android application i got the Exception during the debugging my application ,i gave my exception below,please any one give the solution for this problem..thanks in advance.
**My exception is**
>org.json.JSONException: Value <div of type java.lang.String cannot be converted to JSONObject
new rateLogin().execute(userid, Strbookid,userrating, Deviceid);
//Asychronus task for ratelogin
class rateLogin extends AsyncTask<String, String, String> {
String userid = "";
String Strbookid = "";
String userRating="";
String Deviceid = "";
@Override
protected String doInBackground(String... strings) {
userid = strings[0];
Strbookid = strings[1];
userRating=strings[2];
Deviceid = strings[3];
HttpPost httpPost = null;
List<NameValuePair> nameValuePair = null;
httpPost = new HttpPost(
Rateurl);
// Building post parameters and key and value pair
nameValuePair = new ArrayList<NameValuePair>(4);
nameValuePair.add(new BasicNameValuePair("userid", userid));
nameValuePair.add(new BasicNameValuePair("bookid", Strbookid));
nameValuePair.add(new BasicNameValuePair("userrating", userRating));
nameValuePair.add(new BasicNameValuePair("deviceid", Deviceid));
// Url Encoding the POST parameters and writing error to Log
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
// Making HTTP Request to user rating value
HttpResponse response = httpClient.execute(httpPost);
try
{
//this line only got Exception
String strRet = HttpHelper.request(response);
// writing exception to log of Rate login
}catch(Exception e)
}
Log.d(strRet, "strstrRet");
JSONObject jsonObjRecv=null;
jsonObjRecv = new JSONObject(strRet);
String result = jsonObjRecv.getString("status");
String message = jsonObjRecv.getString("info");
if (result.equals("Success")) {
showalert(message);
}
else {
showalert(message);
}
return null;
}
}