android-volley

android volley caching asynchronous requests - How te get url of the request in ResponseListener

℡╲_俬逩灬. 提交于 2020-01-17 02:40:09
问题 I have in the app a lot of string requests done in volley. In each module there is a different onResponseListener doing always something different. And I need to make them work also offline. So I am getting the response from the cache. Problem is that there can be a lot of requests called asynchronously with different url. Problem is how to remember the url of the request when getting it from cache. Currently it is only in global variable, but as requests can be sent asynchronously, response

Volley send JsonArrayRequest via POST with JsonObject data

落花浮王杯 提交于 2020-01-16 22:22:07
问题 I would like to create JsonArrayRequest using Volley POST but I need to put JSON parameters to the request which look like this {"filter":{"minLat":15.0,"minLng":14.0,"maxLng":12.0,"maxLat":16.2,"validOnly":true,"groupDistance":1,"vehicleType":1,"serviceTypes":[1,2]},"username":"email@email.cz","securityToken":"securityToken"} And I'm not able to figure it out. Is there somebody who can help me? Thank you 回答1: If not too late and your issue hasn't been solved. IMO, you can init your

ImageView subclass to make Rounded Right Corner

放肆的年华 提交于 2020-01-16 16:47:28
问题 I am trying to take an image like these and turn them into the top right 1/4 of the image. The image below is an example of what I need. **UPDATE: ** I have it (sort of) working, but scaling the image creates an unacceptable amount of distortion my code seems terribly inefficient. Any ideas on how to improve this code or a possible better approach? I am subclassing Volley's NetworkImageView. Here is my code <com.RoundedNetworkImageView android:id="@+id/smallProductImage" android:layout_width=

ImageView subclass to make Rounded Right Corner

ぐ巨炮叔叔 提交于 2020-01-16 16:47:26
问题 I am trying to take an image like these and turn them into the top right 1/4 of the image. The image below is an example of what I need. **UPDATE: ** I have it (sort of) working, but scaling the image creates an unacceptable amount of distortion my code seems terribly inefficient. Any ideas on how to improve this code or a possible better approach? I am subclassing Volley's NetworkImageView. Here is my code <com.RoundedNetworkImageView android:id="@+id/smallProductImage" android:layout_width=

Does Volley library handles all the request sequentially

纵饮孤独 提交于 2020-01-16 00:43:08
问题 I am using volley library for performing network operation to speed up the things. My Question is that Does Volley executes the requests which have added in the queue sequentially or parallel. Suppose I add request like Req1, Req2, Req3 , Will they start to run parallel or second request will wait until first finished ?? 回答1: According to the Volley documentation Volley maintains several network threads. If a thread is not doing anything, then it will take on a job in the queue. To answer

Android Volley return value from response

对着背影说爱祢 提交于 2020-01-15 10:36:05
问题 How do I get the response out of onResponse so that I can return it? I have found this but I don't really understand how to implement it for me. How can I return value from function onResponse of Volley? I hope there is an updated method or something easier that I might have missed This is my code public Boolean checkIfPersonExists(Context context, final Person aPerson){ StringRequest postRequest = new StringRequest(Request.Method.POST, USEREXISTS, new Response.Listener<String>() { @Override

Not able to hit api to verify otp ( Used Volley)

廉价感情. 提交于 2020-01-15 04:57:06
问题 i am giving the link to the query i have raised on github respository of AndroidHive please take a look my issue- https://github.com/rajatbeck/LoginWithOTP/issues/1 i made some changes like i am registering with single parameter i.e. phone number Original code - http://www.androidhive.info/2015/08/android-adding-sms-verification-like-whatsapp-part-2/ 来源: https://stackoverflow.com/questions/40481530/not-able-to-hit-api-to-verify-otp-used-volley

android volley post json ID and get result back from PHP server

↘锁芯ラ 提交于 2020-01-15 04:52:29
问题 i am struggling to make this work, basically i get an id from previous activity using intent, now i want to send this id to server so it returns all the data associated with this id. javacode final String URL = "URL"; // Post params to be sent to the server HashMap<String, String> params = new HashMap<String, String>(); params.put("ID", "1"); JsonObjectRequest req = new JsonObjectRequest(URL, new JSONObject(params), new Response.Listener<JSONObject>() { @Override public void onResponse

android volley post json ID and get result back from PHP server

夙愿已清 提交于 2020-01-15 04:51:45
问题 i am struggling to make this work, basically i get an id from previous activity using intent, now i want to send this id to server so it returns all the data associated with this id. javacode final String URL = "URL"; // Post params to be sent to the server HashMap<String, String> params = new HashMap<String, String>(); params.put("ID", "1"); JsonObjectRequest req = new JsonObjectRequest(URL, new JSONObject(params), new Response.Listener<JSONObject>() { @Override public void onResponse

How to download an Image by using Volley?

旧巷老猫 提交于 2020-01-14 09:59:08
问题 I am Trying to download an Image into an ImageView by using the Volley Library. I inject the response of the Volley Library into the ImageView, but I am not getting the desired result. Please check my code and suggest where I can make the changes to get the desired result. public class MainActivity extends AppCompatActivity { Button response_click; TextView text_response; RequestQueue requestQueue; ImageView image_download; String server_url="https://upload.wikimedia.org/wikipedia/commons