2
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

MyActiviy: // パラメータが RateLogin 非同期タスクに渡される場所

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];

/* レート ログイン : XMl Http Post
Here ログイン ユーザー ID、ブック ID、指定されたユーザーのアプリケーション レート、モバイル デバイス ID */ HttpClient httpClient = new DefaultHttpClient(); // HTTP ポストの作成

        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;
     }
 }

Android Studioで注文する際にGoogle API経由で外部ライブラリを追加する方法

Android Studio プロジェクトに外部ライブラリを追加したいと考えています。追加したのですが、Google API より上に並べたいです。現在、Google API は外部ライブラリとして表示されており、追加するライブラリを順序で Google API の上に設定することはできません。Eclipse では可能でしたが、Android Studio ではどうすればよいのでしょうか?

より正確に言うと、いくつかの Android フレームワーク クラスを書き直しており、デフォルトの Android フレームワーク クラスの代わりにそれらを使用したいと考えています。そのため、ライブラリの順序を Android API ライブラリの上に設定したいと考えています。これを行う方法を知っている人はいますか?libの順序を一番上に設定することで、Eclipseでこれを行いました。

4

1 に答える 1

2

サーバーからの応答が間違っていると思います。アプリをデバッグすると、応答が次のようになることがわかります

私は同じ問題に直面しました。したがって、そのサーバーエラーはAndroidではありません.....

于 2015-10-19T10:51:12.620 に答える