android-volley

Bad Request while parsing ArrayJson using Volley in Android Studio

淺唱寂寞╮ 提交于 2019-12-13 02:59:50
问题 I'm new in JSON parsing also for Android, I tried a tutorial found in Internet and how to parse an UnNamed Array this is my Json Array (https://webservicesocs.herokuapp.com/api/DispoMachines) that i want to parse and display it in Android in ListView And this is my code in Android using Volley Library : String ServiceURL = "https://webservicesocs.herokuapp.com/api/DispoMachines"; machinesListVeiw = (ListView) findViewById(R.id.machines_lv); final String result = ""; final ArrayList<Machine>

How to parse JSON using Volley?

强颜欢笑 提交于 2019-12-13 02:49:07
问题 i have some json output like this { "message": "success", "battery": "AHAJAJ1DH13T0021", "data": { "id": 6, "userId": 3, "shopId": 1, "transactionStatus": "PENDING", "expiredAt": "2019-01-04T03:01:18.878Z", "updatedAt": "2019-01-04T02:01:18.916Z", "createdAt": "2019-01-04T02:01:18.916Z", "paymentId": null, "batteryNo": null }, "shopData": { "id": 1, "name": "test1", "tel": "555", "address": "cikarang", "description": "showroom", "latitude": "-6.307923199999999", "longitude": "107

PHP 500 Internal Server Error when calling Volley

允我心安 提交于 2019-12-13 01:16:14
问题 I have a recurring problem in my Android application. Basically I am using PHP and a MYSQL database to register and login users into my app. Registration works fine. I am able to connect to the database and insert the new user into the table without any problems. The issue I am facing is when logging into the app. Whenever I call the login url, I am getting the following error: BasicNetwork.performRequest: Unexpected response code 500 for URL. I tried using other tools to access this url and

Volley does not stop adding date to listview from json

与世无争的帅哥 提交于 2019-12-13 00:06:32
问题 I want app to show dates in listview. My app has TabLayout which imitates this and Listviews which imitate this.So, tabs have listview. After showing all json dates in listview, they load json dates again. It happens when I swipe each tabs like tab1→tab2→tab3→tab1→tab3... . This is may code. If anyone knows what is wrong, please teach me. public class AppController extends Application { public static final String TAG = AppController.class.getSimpleName(); private RequestQueue mRequestQueue;

How to make a Volley Request activity independent in android?

血红的双手。 提交于 2019-12-12 22:18:48
问题 I read the documentation about making an network request activity independent by making a singleton class and passing the application context to it. I implemented it similarly, however I still find that on rotation the app waits for the call again to complete before displaying any data. So what am I doing wrong and how to set it up properly so that the call lasts the lifetime of the application so that it doesn't call every time on orientation change as per the documentation. I know it can be

how to perform file upload using Volley in android?

我的梦境 提交于 2019-12-12 19:18:21
问题 I want to upload files(images,documents etc) from my android application to my server.I'm using Volley library for network calls in my application. I'm using the following code to upload files but it is not performing any operation.(showing volley timeout error finally) public class MultipartRequest extends Request<String> { private MultipartEntity entity = new MultipartEntity(); private static final String FILE_PART_NAME = "file"; private final Response.Listener<String> mListener; private

JsonRequest VS StringRequest in Android Volley

你。 提交于 2019-12-12 19:13:29
问题 I am using Android Volley for network calls. Generally I use JSONRequest to receive the json data and then convert them into object using GSON. new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { ///Convert response.toString() to POJO using GSON } }; If I use plain string request and then convert string to objects using GSON, will that be more faster than JSONRequest? new Response.Listener<String>() { @Override public void onResponse(String response)

Volley: TimeOutError

早过忘川 提交于 2019-12-12 18:41:27
问题 i want to fetch some data from a URL and the server is very slow... So whenever i use volley to get the data, I get TimeOurError , Is there anyway i can handle for how long volley should try to get the data as the server is slow...It takes little time and i also want to run this request constantly to check data, I plan to use Timer for it...Is it okay to use Timer for continuously checking data? Here is my volley request for now...It works for other URL's public void checkData() {

Why is Volley's onResponse not called

余生颓废 提交于 2019-12-12 17:54:26
问题 I am fetching json data through Volley. The problem I am having is that Volley's onResponse is never called, and hence the data are not parsed and displayed. Sample JSON data { "title": "This is a sample text title title", "cat": { "origin" : "United states", "target" : "Asia", }, "content": "Lorem ipsum ipsum trxt hag jlak jshss jsyts pjqgq uuqtyq usiuqjo uwywh", } NewsActivity public class NewsDetails extends AppCompatActivity { private final String TAG = "NewsDetails"; private

ANDROID Volley + Gson (POST)

混江龙づ霸主 提交于 2019-12-12 17:18:33
问题 hello. I want to make a post request using gson. I got the class implemented into android website... http://developer.android.com/intl/pt-br/training/volley/request-custom.html UserRequestHelper.userRequest(Request.Method.POST, EndpointURL.USUARIO, null, new Response.Listener<Usuario>() { @Override public void onResponse(Usuario response) { Toast.makeText(getActivity(), "Cadastro realizado com sucesso!", Toast.LENGTH_SHORT).show(); } }, new Response.ErrorListener() { @Override public void