If you think the Android project khandroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright (C) 2012-2014 Ognyan Bankov
*/*fromwww.java2s.com*/
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/package com.github.khandroid.volley;
import org.json.JSONObject;
import com.android.volley.Response.ErrorListener;
import com.android.volley.toolbox.JsonObjectRequest;
publicclass VRestRequest extends JsonObjectRequest {
publicstatic String RESPONSE_KEY_STATUS = "status";
publicstatic String RESPONSE_KEY_PAYLOAD = "payload";
publicstatic String RESPONSE_KEY_RESPONSE_CODE = "response_code";
publicstaticint RESPONSE_STATUS_OK = 1;
publicstaticint RESPONSE_STATUS_ERR = 0;
VRestRequest(String url,
JSONObject jsonRequest,
com.android.volley.Response.Listener<JSONObject> listener,
ErrorListener errorListener) {
super(url, jsonRequest, listener, errorListener);
}
VRestRequest(int method,
String url,
JSONObject jsonRequest,
com.android.volley.Response.Listener<JSONObject> listener,
ErrorListener errorListener) {
super(method, url, jsonRequest, listener, errorListener);
}
publicinterface Listener {
void onSuccess(JSONObject json, int responseCode);
void onSoftError(int responseCode);
void onHardError();
}
}