|
@@ -199,8 +199,11 @@ public class Network {
|
|
|
// 获取返回数据
|
|
// 获取返回数据
|
|
|
int responseCode = connection.getResponseCode();
|
|
int responseCode = connection.getResponseCode();
|
|
|
|
|
|
|
|
- Log.i(TAG, "getJson: " + "Request " + url + " Get Response Code" + responseCode);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Log.d(TAG, "getJson: " + "Request " + url + " Get Response Code" + responseCode);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if(connection.getResponseCode() == 200){
|
|
if(connection.getResponseCode() == 200){
|
|
|
InputStream is = connection.getInputStream();
|
|
InputStream is = connection.getInputStream();
|
|
|
|
|
|
|
@@ -214,7 +217,9 @@ public class Network {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Log.d(TAG, "Response: content begin");
|
|
Log.d(TAG, "Response: content begin");
|
|
|
- Log.d(TAG, sb.toString());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ dbgUtil.Logd(TAG,sb.toString());
|
|
|
|
|
+// Log.d(TAG, sb.toString());
|
|
|
Log.d(TAG, "Response: content end");
|
|
Log.d(TAG, "Response: content end");
|
|
|
|
|
|
|
|
if (sb.length() <= 0)
|
|
if (sb.length() <= 0)
|
|
@@ -1020,63 +1025,63 @@ public class Network {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- public static JSONObject submit_editor(String request_url,Bundle params) {
|
|
|
|
|
-
|
|
|
|
|
- if (request_url == null || request_url.isEmpty() || params == null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- String json_string = getJson(request_url,params,REQUEST_TIMEOUT);
|
|
|
|
|
-
|
|
|
|
|
- if (json_string == null || json_string.isEmpty()) {
|
|
|
|
|
- json_string = "{\"result\" : \"1\"}";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- return new JSONObject(json_string);
|
|
|
|
|
- } catch (JSONException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- public static JSONObject save_editor(String request_url,Bundle params) {
|
|
|
|
|
-
|
|
|
|
|
- if (request_url == null || request_url.isEmpty() || params == null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- String json_string = getJson(request_url,params,REQUEST_TIMEOUT);
|
|
|
|
|
-
|
|
|
|
|
- if (json_string == null || json_string.isEmpty()) {
|
|
|
|
|
- json_string = "{\"result\" : \"1\"}";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- return new JSONObject(json_string);
|
|
|
|
|
- } catch (JSONException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static JSONObject request_editor(String request_url,Bundle params) {
|
|
|
|
|
-
|
|
|
|
|
- if (request_url == null || request_url.isEmpty() || params == null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- String json_string = getJson(request_url,params,REQUEST_TIMEOUT);
|
|
|
|
|
-
|
|
|
|
|
- if (json_string == null || json_string.isEmpty()) {
|
|
|
|
|
- json_string = "{\"result\" : \"1\"}";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- return new JSONObject(json_string);
|
|
|
|
|
- } catch (JSONException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// public static JSONObject submit_editor(String request_url,Bundle params) {
|
|
|
|
|
+//
|
|
|
|
|
+// if (request_url == null || request_url.isEmpty() || params == null) {
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// String json_string = getJson(request_url,params,REQUEST_TIMEOUT);
|
|
|
|
|
+//
|
|
|
|
|
+// if (json_string == null || json_string.isEmpty()) {
|
|
|
|
|
+// json_string = "{\"result\" : \"1\"}";
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// return new JSONObject(json_string);
|
|
|
|
|
+// } catch (JSONException e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// public static JSONObject save_editor(String request_url,Bundle params) {
|
|
|
|
|
+//
|
|
|
|
|
+// if (request_url == null || request_url.isEmpty() || params == null) {
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// String json_string = getJson(request_url,params,REQUEST_TIMEOUT);
|
|
|
|
|
+//
|
|
|
|
|
+// if (json_string == null || json_string.isEmpty()) {
|
|
|
|
|
+// json_string = "{\"result\" : \"1\"}";
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// return new JSONObject(json_string);
|
|
|
|
|
+// } catch (JSONException e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// public static JSONObject request_editor(String request_url,Bundle params) {
|
|
|
|
|
+//
|
|
|
|
|
+// if (request_url == null || request_url.isEmpty() || params == null) {
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// String json_string = getJson(request_url,params,REQUEST_TIMEOUT);
|
|
|
|
|
+//
|
|
|
|
|
+// if (json_string == null || json_string.isEmpty()) {
|
|
|
|
|
+// json_string = "{\"result\" : \"1\"}";
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// try {
|
|
|
|
|
+// return new JSONObject(json_string);
|
|
|
|
|
+// } catch (JSONException e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
}
|
|
}
|