android-volley

Volley give me Out of memory exception after I make a lot of request with big amount of data

为君一笑 提交于 2019-12-22 10:45:00
问题 I have a Page Viewer and inside every page I have list View , this list view will have 10 records using a web service , so the page viewer use three calls of the web service to populate three pages (the current , the left and the right page) but after I make a lot of swipes I am getting this exception : java.lang.OutOfMemoryError: pthread_create (stack size 16384 bytes) failed: Try again at java.lang.VMThread.create(Native Method) at java.lang.Thread.start(Thread.java:1029) at com.android

Volley Exception throws BroadCastReceiver

烈酒焚心 提交于 2019-12-22 09:08:19
问题 I am developing my project using volley library. When I parse data it throws error sometime if any network problem or server side error, I want to display this error message using toast but I can't handle this and not show any toast on error of volley. So I want to manage this problem using broadcast receiver. If it possible then please give me any suggestion or solution for solve this problem. My code of display toast on error using volley is: mRequestQueue = Volley.newRequestQueue(context);

Volley Post request ,Send Json object in Json array request

有些话、适合烂在心里 提交于 2019-12-22 08:44:38
问题 To say in simple words i want to send this {"Id":7,"Name":"MyName"} data To server using Volley Post Request. It has 1 integer and 1 String and response i get is Jsonarray I tried Following ways but none are working as it is json array request i cannot send data in argument as 3rd argument only takes JsonArray and i have to send JsonObject so kept it as null new JsonArrayRequest(Method,Url,JsonArray,ResponseListener,ErrorListner) I cannot put it in HashMap as 1 of the value is integer, and it

How to get String response from JSONObject in Volley

只愿长相守 提交于 2019-12-22 06:30:03
问题 I have created JSONRequest by using volley, It successfully hits the service, I checked the service end, It receives the data, and send "Success" in return. The problem is that, Service returns String in output, and Volley excepts some JSON Data in output. So it executes the onError Method, instead of onResponse . Kindly guide me how to make it accept string response, or is it not possible when you are using JSONObject as request. Request<JSONObject> jsonObjectRequest = new JsonObjectRequest

Volley and processing data returned in background on Android

瘦欲@ 提交于 2019-12-22 04:43:22
问题 I have some troubles finding some informations about Volley and the response.Listener. Basically I have an operation to ask data to my backend, call is made throughout Volley in background (Handled by Volley itself) meanwhile it call the onResponse on the main thread. Do I need to do a runnable by myself to process theses datas in background or there is a way to force the onResponse to run in background ? Thank you. EDIT : Here is the code I'm running then. private Response.Listener<String>

How many Volley request queues should be maintained?

让人想犯罪 __ 提交于 2019-12-22 01:56:40
问题 Currently I am maintaining one static Volley request queue as described here: Instantiating core Volley objects private static RequestQueue mReqQueue; Should there be one and only one static request queue per app? What is the harm in having more than one? for example what if I wanted one request queue just to process twitter requests. And another one for everything else like authentication, image retrieval etc. 回答1: I think Ficus Kirkpatrick said somewhere in his presentation on Volley that

android efficient way to upload image to server

你说的曾经没有我的故事 提交于 2019-12-22 01:19:09
问题 I'm looking for a way to upload an image from android to php server, currently I'm encoding the image to base64 and send it, but it's too slow, is there is a better way I'm using volley as network client. 回答1: My 2 cents: Few things can be improved depending on what you are targeting. If you are worried about the data usage , then you can decrease the size of the image before uploading. Now a days for the newer phone models, the picture resolutions are very high. You can alter the size of the

Android Volley do not cache images

假装没事ソ 提交于 2019-12-22 01:05:19
问题 I used this tutorial to show and cache image in grid using Volley. when internet is connected , it works fine .but after disconnecting the image do not show.it seems Volley do not cache any image. the problem is, there is no complete documentation about caching image using Volley.here is my code : xml: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com

Volley String Request does'nt give Response in android

爷,独闯天下 提交于 2019-12-22 01:04:19
问题 I used Volley String request for Post method..but its not giving correct response..When i used JsonObject request then it will give me correct response..I am so confused ,i don't understand what is problem with string request..Please anyone can help me with string request... this is my code.. StringRequest requestQueue =Volley.newRequestQueue(MainActivity.this); String URL ="http://demoangularaims.azurewebsites.net/api/v1/API_NI_ACD_FILL_COMMON_DDL_SP"; Log.d(TAG, " url=" + URL);

How to implement a listview using volley android

时间秒杀一切 提交于 2019-12-22 00:15:09
问题 I'm developing an app that grabs a list of clients of an API, and I need to show it in a listview, I'm using volley and what I tried to do is the following, but it's not working: public ListView txtDisplay; @Override protected Boolean doInBackground(Void... params) { try { txtDisplay = (Listview) findViewById(R.id.listView); String url = "http://192.168.1.1/rep-mais-api/api"; JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>(