android-volley

Android volley to upload image

天涯浪子 提交于 2019-12-20 04:16:06
问题 I followed this tutorial to upload image to my server. But it closes my app once I click on one of the pictures in my gallery. I have two buttons one to browse and the other to upload once the user made their selection. To browse I do: private void showFileChooser() { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST); } And to get the results I

Why are my “posts” loading in different sizes in android recyclerview?

懵懂的女人 提交于 2019-12-20 04:12:45
问题 Okay, this is how my recyclerview is showing my "posts". Can anyone tell me why? I will post source code as well. I have tried changing some of the code with no success. Also, when I scroll through my RecyclerView, some of them resize to smaller or larger sizes. Any and all help is appreciated! fragment_home.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent"

Not getting value from server into my Textview using android

倖福魔咒の 提交于 2019-12-20 04:12:39
问题 I am new to android , here if i choose forgot password link it should go to next activity and there if i write correct email then it should setText the correct password from server.But i am not getting value from server . here is my ForgotPassword.java: public class ForgotPasswordActivity extends AppCompatActivity { private String fremail; private ProgressDialog pDialog; protected EditText femail; protected Button mSubmitButton; TextView pas; private static String url_create_book = "http:/

org.json.JSONException: End of input at character 0 of, android

我是研究僧i 提交于 2019-12-20 03:25:31
问题 I am implementing an android app and trying to make a register and login screens. my app is connected to a server, here is the part my code that makes error: public void onResponse(String response) { Log.d(TAG, "Register Response: " + response.toString()); hideDialog(); try { JSONObject jObj = new JSONObject(response); boolean error = jObj.getBoolean("error"); if (!error) { // User successfully stored in MySQL // Now store the user in sqlite String uid = jObj.getString("uid"); JSONObject user

Volley - NetworkImageView sometimes doesn't show the error image?

不打扰是莪最后的温柔 提交于 2019-12-20 02:39:08
问题 So I've decided to try out the new Volley library as shown on Google IO 2013. I've tried it out while using the easy solution of NetworkImageView to show multiple images on a GridView . It works nice and shows images, but if I let it download the images and then I turn off the WiFi during the download, it doesn't show an error as if everything still loads. Not only that, but if I restore the connection, it doesn't resume the loading. Why does it occur, and how can I fix it? Maybe it's

Android Volley POST Sending Parameters is always null

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 21:46:31
问题 I am new in android.Now i am doing one application.For this one i need to send data into server.Now i am using Volley post method.But the parameters is always shows null when i send data into server using volley.here i attached the code please check it.Here i am using fragments. Code Section String url = "http://192.168.1.182:8084/name/registration.jsp"; final ProgressDialog pDialog = new ProgressDialog(this.getActivity()); pDialog.setMessage("Loading..."); pDialog.show(); RequestQueue rq =

Volley Request with Raw data

非 Y 不嫁゛ 提交于 2019-12-19 11:37:15
问题 In my application I have to send POST request with JSON req param, I tried to create request with Postman Rest Client and it is working fine but not working with below code. In Postman req parameter sent as raw data, But I am not sure how to send it with Volley request. public Request getHTTPPostReqResponse(String URL, Class mClass, final Map<String, String> params, final String contentType, final String body) { mResponseListener.requestStarted(); Request mRequest = new GsonRequest(Request

How to Set Tag to the request and get it from Response Volley asynchronous request?

蹲街弑〆低调 提交于 2019-12-19 10:48:13
问题 I have an Android application with multiple REST Api's. The API's are managed using the Volley library. The response is getting and it's woking fine. But when I make asynchronous requests, I can't identify the response of each request. My request method is this: private void httpCall(String URL, String json, String session key, int type) { try { SSLContext sslcontext = SSLContext.getInstance("TLSv1"); sslcontext.init(null, null, null); SSLSocketFactory NoSSLv3Factory = new

Need to send multiple Volley Requests - in a sequence

喜你入骨 提交于 2019-12-19 05:45:27
问题 I need to use volley to send a request to retrieve a membershipid then pass that membership id into the second volley request to retrieve stats on that member. I have a problem with my first request working perfectly but the second request seems to start before the variable is returned to be passed. Anyone know how to prevent the second request from starting before value is returned? 回答1: you can't just write each request sequentially and wait to perform each after each success response ...

Add custom headers in volley request

戏子无情 提交于 2019-12-19 03:26:01
问题 I have a Volley Request code RequestQueue queue = Volley.newRequestQueue(this); String url =<My URL>; // Request a string response from the provided URL. StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { // Display the first 500 characters of the response string. mTextView.setText("Response is: "+ response.substring(0,500)); } }, new Response.ErrorListener() { @Override public void