android-volley

com.android.volley.NoConnectionError: java.net.ProtocolException: Unexpected status line: HTTP/1.1 401.3 Unauthorized

南楼画角 提交于 2020-01-07 05:39:13
问题 The following is my code. I got com.android.volley.NoConnectionError: java.net.ProtocolException: Unexpected status line: HTTP/1.1 401.3 Unauthorized. RequestQueue queue = Volley.newRequestQueue(this); String url = "http://echo.jsontest.com/key/value/one/two"; JsonObjectRequest getRequest = new JsonObjectRequest(Request.Method.GET, url, (String)null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { Log.e("LOG_VOLLEY","response : "+response.toString

manually retry Volley request on android

£可爱£侵袭症+ 提交于 2020-01-07 05:27:04
问题 I know there's a RetryPolicy to use, but looks like it performs retry automatically. what I want is to trigger the retry when user clicks the retry button. I tried to store the request and reuse it but found that Volley actually destroys listeners after request is completed. that makes me no way to do any user interaction after the retry. I can however reconstruct the same request again but it doesn't look right and is making things more complicated. Is there a way to perform a retry manually

403 AuthFailureError in Volley

吃可爱长大的小学妹 提交于 2020-01-07 03:08:34
问题 I am having a very strange situation. I have a running script that makes JsonObjectRequest using Volley Singletone. The script has been working perfectly in domain example1.com. Recently I bought example2.com and hosted in the same hosting account. And when I copy all the php files as it is in the second domain, I am getting error "BasicNetwork.performRequest: Unexpected response code 403". So, I have exactly same php files called using JsonObjectRequest and Volley Singletone working in

403 AuthFailureError in Volley

佐手、 提交于 2020-01-07 03:08:07
问题 I am having a very strange situation. I have a running script that makes JsonObjectRequest using Volley Singletone. The script has been working perfectly in domain example1.com. Recently I bought example2.com and hosted in the same hosting account. And when I copy all the php files as it is in the second domain, I am getting error "BasicNetwork.performRequest: Unexpected response code 403". So, I have exactly same php files called using JsonObjectRequest and Volley Singletone working in

How to use gson and volley parse nested json?

蹲街弑〆低调 提交于 2020-01-07 02:54:30
问题 Here is the json data I want to use: { "name" : "Ravi Tamada", "email" : "ravi8x@gmail.com", "phone" : { "home" : "08947 000000", "mobile" : "9999999999" } } Here is my JsonObjectRequest: JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, APITEST,null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject jsonObject) { Gson gson = new Gson(); People people; people = gson.fromJson(jsonObject.toString(),People.class); tv_city.setText(""

Volley String cannot be converted to JSONObject

安稳与你 提交于 2020-01-07 00:05:47
问题 I'm always getting the following error as long as i put a array into Params. Even after converting to String it still gives that error. The code works fine without the contactlist array inside it. Any idea? Error com.android.volley.ParseError: org.json.JSONException: Value Created of type java.lang.String cannot be converted to JSONObject Sample response: { "username": "test2", "lists": [ "contact_0", "contact_1", "contact_2", "contact_3", "contact_4", "contact_5", "contact_6", "contact_7",

POST request with Volley

左心房为你撑大大i 提交于 2020-01-06 16:21:11
问题 I'm making a basic mobile app to interact with a nosql database. So far, I've had no problems using Volley. I have two main entities in my database, and both are storing all of their attributes as strings. With one entity, Volley's GET and POST works fine, but with the other entity, the GET request works but not the POST request (some parameters are null). The page I'm having trouble with is intended to let the user edit data he/she has already put in. I first populate it with a Volley GET

Volley RequestQueue Unknown Class?

爷,独闯天下 提交于 2020-01-06 03:36:30
问题 I'm trying to implement a simple JsonObjectRequest with Volley. Everything seems to be working fine until I try to add the request to the queue, in which I get an "unknown class" error. I figure it has to be something simple, but I'm banging my head. What gives? public void authGetRequest() { RequestQueue queue = Volley.newRequestQueue(this); // this = context // prepare the Auth Get Request JsonObjectRequest lastFMAuthRequest = new JsonObjectRequest(Request.Method.GET, lastFMKeyURL, null,

How do I upload large files (10MB) in Android?

て烟熏妆下的殇ゞ 提交于 2020-01-06 02:24:47
问题 I am currently used to using Volley to make my requests and upload json. However, the developers of Volley state that it should not be used to upload large files. I was wondering if there is a standard that currently does this in Android? 来源: https://stackoverflow.com/questions/28575279/how-do-i-upload-large-files-10mb-in-android

How do I upload large files (10MB) in Android?

邮差的信 提交于 2020-01-06 02:24:05
问题 I am currently used to using Volley to make my requests and upload json. However, the developers of Volley state that it should not be used to upload large files. I was wondering if there is a standard that currently does this in Android? 来源: https://stackoverflow.com/questions/28575279/how-do-i-upload-large-files-10mb-in-android