android-volley

How to upload array of image files using MultiPart in Android Volley Library

Deadly 提交于 2019-12-13 17:41:25
问题 I'm just beginner in Android App development. I want to upload image files using Android Volley library. I have used this helper class found somewhere in some blog.: public class VolleyMultiPartRequest extends Request<NetworkResponse> { private final String twoHyphens = "--"; private final String lineEnd = "\r\n"; private final String boundary = "apiclient-" + System.currentTimeMillis(); private Response.Listener<NetworkResponse> mListener; private Response.ErrorListener mErrorListener;

Services or intent services to send location updates every 5 sec to server endlessly?

我的未来我决定 提交于 2019-12-13 09:31:52
问题 I am using GoogleCientApi object to fetch location updates and other Accelerometer sensors and send it to server every 5 sec . I want it to run in background endlessly i.e. 24*7 with battery optimisation. Nothing needs to be updated in UI . Please suggest whether to use Service or IntentService ? If using Service how to run it using Handler ? Any suggestion or article link will be helpful. 回答1: If you want to achieve this using service public class MyService extends Service { @Nullable

Using Volley without Gson

*爱你&永不变心* 提交于 2019-12-13 08:37:11
问题 Today I got to know that Retrofit uses gson(or any other convertor) to serialize or deserialize the json response (response that was got using okhttp or any related library). Now, when I was naive(in some sense still am) and I used to use Volley and at that time I never used Gson or any related library and same for okhttp.But i used to get my response and inflate it successfully on my views. 1. Now does Volley internally do what Retrofit does using Gson and Okhttp? If not? 2. Then how did i

Volley android “javax.net.ssl.SSLHandshakeException: Handshake failed”

血红的双手。 提交于 2019-12-13 08:16:47
问题 Hi I'm rebuilding a API call using volley library this is my test code to send XML data and receive xml response (I just need to successfully receive response in string format) String url ="https://prdesb1.singpost.com/ma/FilterOverseasPostalInfo"; final String payload = "<OverseasPostalInfoDetailsRequest xmlns=\"http://singpost.com/paw/ns\"><Country>AFAFG</Country><Weight>100</Weight><DeliveryServiceName></DeliveryServiceName><ItemType></ItemType><PriceRange>999</PriceRange>

Json Array return blank (“”) when run Oncreate (android)

你。 提交于 2019-12-13 08:11:46
问题 I am trying to fetch json data from server using volley library and store in array list then display data using spinner. my code on php server side: echo json_encode(array('result'=>$result)); My fetch data function: private void getEventRespondTest (RequestQueue requestQueue) { //Creating a string request JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST,Config.DATA_URL, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject respond) {

Volley onResponse method not triggered

非 Y 不嫁゛ 提交于 2019-12-13 08:05:50
问题 I am trying to parse a JSON file and fetch certain info from every person in the JSON file. I have created a parseJSON() function to do this for me, but I have run into a problem. The application works but it does not receive the information from the JSON file. After placing a breakpoint in the function, I realised that the application does not even acess the onResponse() function. I have read the answers of some similar questions like this, but they did not seem to be of help. What seems to

Malformed URL Exception while using Volley

雨燕双飞 提交于 2019-12-13 07:54:57
问题 Getting the Error below while using Android-Volley in android. The same problem remains unsolved here too... 08-27 14:46:18.779 26990-26990/com.rev.volleydemo D/VOLLEY﹕ http://api.androidhive.info/volley/person_object.json 08-27 14:46:18.879 26990-27004/com.rev.volleydemo E/Volley﹕ [619] NetworkDispatcher.run: Unhandled exception java.lang.RuntimeException: Bad URL null java.lang.RuntimeException: Bad URL null at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:151) at

Load local data if internet connection not available

爱⌒轻易说出口 提交于 2019-12-13 07:19:12
问题 I have an android application that display data from my external Database so from several tables. Everything work fine while internet connection is available (all data come from URL link and they are been parsed with volley). But how can I save and load lastest data when internet is not available. What is the best way to do that. Im new in android.... Please help. 回答1: Normally Volley and also HttpStack it uses allows you to seamlessly cache responses. This however depends on your responses

Using volley to upload video

旧巷老猫 提交于 2019-12-13 06:40:59
问题 In my app the users should be able to upload their videos from their phone to a remote server. I don't want to use approaches like this where I have to take care of everything along with many other demerits. Is it possible to use volley to this aim? If yes, please explain how or mention a tutorial. 回答1: You can use the following snippet for any multipart request using volley. import com.android.volley.AuthFailureError; import com.android.volley.NetworkResponse; import com.android.volley

Volley is not showing the data in the RecyclerView

会有一股神秘感。 提交于 2019-12-13 06:35:15
问题 I am trying to get data from a JSON File using volley method and show it in RecyclerView but its not showing any data on RecyclerView. mysql Databse is configured on xampp. Code is below. I am new to android so you have to give your answers in detail. Here is my PHP file getdata.php: $connect = mysqli_connect("127.0.0.1", "root" , "", "recycleview_volley"); $query = "SELECT * FROM image_data"; $result = mysqli_query($connect,$query); $recycler_data = array(); while($row = mysqli_fetch_array(