android-volley

Sending image via android volley with php [closed]

本秂侑毒 提交于 2019-12-21 20:51:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am making a post from android to php with data and an image. I'm scaling the image down in android and base 64 encoding it. When it is sent via volley, most images are somewhere between 70 and 100kbs. The problem I have is that a few images for whatever reasons come out to be slightly bigger, like 130kbs. At

Android Volley does not seem to post HTTP parameters

谁说胖子不能爱 提交于 2019-12-21 20:43:54
问题 I've seen a few of these questions on StackOverflow but I can't seem to work out why this code is not working for me. public void postMethod(final String msg) { String url = "http://192.168.1.30/endpoint"; RequestQueue queue = Volley.newRequestQueue(this); StringRequest sr = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() { @Override public void onResponse(String response) { // Handle response... } }, new Response.ErrorListener() { @Override public void

Android Volley - Show progress bar in listview adapter when loading image

故事扮演 提交于 2019-12-21 20:25:50
问题 I tried to get image from network with Volley in listview item. While downloading image, the progress bar is showing, when complete, it should be hide. Here is my adapter: public class NewsAdapter extends CursorAdapter{ public NewsAdapter(Context context, Cursor c) { super(context, c, true); } @Override public Cursor getItem(int position) { return (Cursor) super.getItem(position); } @Override public void bindView(View view, final Context context, Cursor cursor) { final NetworkImageView

E/Volley﹕ [194] BasicNetwork.performRequest: Unexpected response code 307 for url

别来无恙 提交于 2019-12-21 20:22:38
问题 I am trying to send a json obj by POST to an api via volley in my android app and capture the json response but i keep getting this error: E/Volley﹕ [194] BasicNetwork.performRequest: Unexpected response code 307 for http://phoneapi.adro.co/Services/AdService.svc/GetAd . there is the piece of code that make the request: public class JsonObjectSend { private static final String TAG_action = "Action"; private static final String TAG_acValue = "ActionValue"; private static final String TAG_bg =

Fragment, Volley and RecyclerView

我是研究僧i 提交于 2019-12-21 17:57:52
问题 I hope someone out there can help me solve my problem. I have android app that have 3 tabs, i use fragment, first tab is recyclerView list, second tabs is map. the problem is in tabs 1, i need to fetch data with volley to recyclerView on tabs 1, if run fine but i cannot see the data on first app start, but when i change tab and back to tab 1 again it will refresh the data and show the data on recyclerView. Adapter.java public class CustomListAdapterWarkop extends RecyclerView.Adapter

How to have a reliable Volley request with no retries policy

主宰稳场 提交于 2019-12-21 17:10:32
问题 When I am on a slow connection and making a POST request, Volley retries my request multiple times and after it all ends up hitting my errorListener . Sometimes, these retries actually succeeded in posting data. The user will assume that the request failed, but in truth, if they refreshed the data they'd see the data was POSTed twice to the server (or however many successful retries in the bunch). I want give Volley a very dumbed-down retry policy: I want it to try a request for 15 seconds

How to do a simple async task using volley library android

六眼飞鱼酱① 提交于 2019-12-21 09:33:22
问题 As you know Google has announced a new library Volley to manage network request based on HTTP Protocol. But if i want to use this library to connect to msql db . Currently i am using async task to do my network calls . How to implement volley library to do async task ? any links or example . sorry for bad english :) 回答1: Volley is starting background thread(s) on its own so all the network requests are executed off the UI thread so basically you don't need to use AsyncTask anymore. Of course

Volley NetworkImageView using https

和自甴很熟 提交于 2019-12-21 06:51:43
问题 I am using facebook photo's in my app. The facebook photo's are stored behind a https url. Can somebody give me an example to load an image with the networkimageview using https? 回答1: I had similar problems, not with facebook, but with images under https. Besides there was a self-signed certificate, plus a lot of redirect, cookies management etc.. So I used HttpClient Stack with Volley and now everything works great. Maybe this could be helpful for your problem. You can skip all the all the

Android Volley Https SSL self signed and Google Maps API

两盒软妹~` 提交于 2019-12-21 05:33:07
问题 We are working with Android Volley and using a self certificated SSL that works correctly, but now we want to implement Google Maps and it doesn't work; it just doesn't throws any error, it just shows a greyed out screen This is our implementation of Volley: public class AppSingleton { private static AppSingleton mAppSingletonInstance; private RequestQueue mRequestQueue; private static Context mContext; private AppSingleton(Context context) { mContext = context; mRequestQueue =

Send raw post request using volley

久未见 提交于 2019-12-21 04:50:20
问题 I want to send post request with raw string rather than setting params using volley. I have tried to override the getBody method in StringRequest like following: @Override public byte[] getBody() throws AuthFailureError { return rawString.getBytes(); } It won't even send the request and gives the error: com.android.volley.TimeoutError Any help will be appreciated. 回答1: I got so ... RequestQueue queue = Volley.newRequestQueue(this); queue.add(myReq); ... StringRequest myReq = new StringRequest