android-volley

How to post request parameters when using JsonArrayRequest in Volley

假装没事ソ 提交于 2019-12-17 16:53:05
问题 I am newbie to Json parsing. I am trying to read a json data using JsonArrayRequest but I am little confused in sending parameters and use POST method.In case of JsonObjectRequest i can send the method type,url,params but In JsonArrayRequest how to send params like username and password and use POST method.please help me out.here is the code i have written. final JsonArrayRequest jsonObjReq = new JsonArrayRequest(MySingleton.getInstance().getDOWNLOAD_SERVICES_URL(), new Response.Listener

Delete Request With header and Parametes Volley

安稳与你 提交于 2019-12-17 16:48:17
问题 Hi i want to Send Delete Request to server using Volley along Headers and body parameters. but i am not able to send request successfully What i have tried JSONObject jsonbObjj = new JSONObject(); try { jsonbObjj.put("nombre", Integer.parseInt(no_of_addition .getText().toString())); jsonbObjj.put("cru", crue); jsonbObjj.put("annee", 2010); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } VolleyRequest mVolleyRequest = new VolleyRequest( Method.DELETE, url,

Parse Android Volley JSONArray response

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 15:58:21
问题 I'm sending a JSONArray GET request with Volley, and it's returning the specified JSON array. Here's my Request: JsonArrayRequest getRequest = new JsonArrayRequest(url, new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { Log.d("Response", response.toString()); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Log.d("Error.Response", error.toString()); } } ); VolleySingleton.getInstance(this).addToRequestQueue

Volley request not taking parameters

大城市里の小女人 提交于 2019-12-17 14:57:22
问题 I have a custom volley request, but it didn't take my params when sending request, what's wrong with my code? I set a breakpoint at getParams and getPostParams , but none of them went through. I used com.mcxiaoke.volley:library:1.0.+ which is forked from google volley to support maven. I find the class worked well at real device but cann't work at genymotion. public class GsonRequest<T> extends Request<T> { private Class<T> clazz; private Map<String, String> headers; private Map<String,

How to create a proper Volley Listener for cross class Volley method calling

两盒软妹~` 提交于 2019-12-17 13:06:13
问题 I aim to call Volley from another class in, a very succinct, modular way ie: VolleyListener newListener = new VolleyListener(); VolleySingleton.getsInstance().somePostRequestReturningString(getApplicationContext(), newListener); JSONObject data = newListener.getResponse(); But am having allot of trouble getting the listener portion to work so as to be able to access the resulting data from a method such as newListener.getResponse(); There are a few questions on this site that generally

How to create a proper Volley Listener for cross class Volley method calling

独自空忆成欢 提交于 2019-12-17 13:06:11
问题 I aim to call Volley from another class in, a very succinct, modular way ie: VolleyListener newListener = new VolleyListener(); VolleySingleton.getsInstance().somePostRequestReturningString(getApplicationContext(), newListener); JSONObject data = newListener.getResponse(); But am having allot of trouble getting the listener portion to work so as to be able to access the resulting data from a method such as newListener.getResponse(); There are a few questions on this site that generally

How to send a POST request with JSON body using Volley?

此生再无相见时 提交于 2019-12-17 10:55:10
问题 How to pass these parameter into POST method using Volley library. API link: http://api.wego.com/flights/api/k/2/searches?api_key=12345&ts_code=123 Screenshot of JSON structure I tried this but again facing error. StringEntity params= new StringEntity ("{\"trip\":\"[\"{\"departure_code\":\"," +departure,"arrival_code\":\"+"+arrival+","+"outbound_date\":\"," +outbound,"inbound_date\":\","+inbound+"}\"]\"}"); request.addHeader("content-type", "application/json"); request.addHeader("Accept",

Android Volley POST string in body

冷暖自知 提交于 2019-12-17 10:47:16
问题 I'm trying to use Volley library to communicate with my RESTful API. I have to POST string in the body, when I'm asking for the bearer Token. String should look like this: grant_type=password&username=Alice&password=password123 And header: Content-Type: application/x-www-form-urlencoded More info about WebApi Individual Accounts: http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api Unfortunately I can't figure out how can I solve it.. I'm trying something like this:

Android Volley ImageLoader - BitmapLruCache parameter?

别说谁变了你拦得住时间么 提交于 2019-12-17 08:26:19
问题 I am having trouble implementing Image cache using the new Volley library. In the presentation, code look like this mRequestQueue = Volley.newRequestQueue(context); mImageLoader = new ImageLoader(mRequestQueue, new BitmapLruCache()); The BitmapLruCache is obviously not included in the toolkit. Any idea how to implement it or point me to some resources? http://www.youtube.com/watch?v=yhv8l9F44qo @14:38 Thanks! 回答1: import android.graphics.Bitmap; import android.support.v4.util.LruCache; public

Android Volley ImageLoader - BitmapLruCache parameter?

℡╲_俬逩灬. 提交于 2019-12-17 08:26:16
问题 I am having trouble implementing Image cache using the new Volley library. In the presentation, code look like this mRequestQueue = Volley.newRequestQueue(context); mImageLoader = new ImageLoader(mRequestQueue, new BitmapLruCache()); The BitmapLruCache is obviously not included in the toolkit. Any idea how to implement it or point me to some resources? http://www.youtube.com/watch?v=yhv8l9F44qo @14:38 Thanks! 回答1: import android.graphics.Bitmap; import android.support.v4.util.LruCache; public