android-volley

Volley JsonObjectRequest response

拟墨画扇 提交于 2020-01-25 08:09:05
问题 I'm retrieving data from my server through JSON using Volley JSONObjectRequest to achieve this. After getting the JSON response, I want to save it into a variable and use it through out the activity. Below is my code sample: private String description; private int status; private boolean validateIntegrationCode() { if (checkNetwork()) { String url = "sample url"; JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override

Android Load Full Image Recyclerview Cardview

偶尔善良 提交于 2020-01-25 07:24:08
问题 The following is my recyclerview using php mysql and volley library in the attached image. As of now when one clicks the displayed image a toast of the image name appears as seen. Is it possible to load the full image click instead of the toast message?. Thank you in advance MAIN ACTIVITY @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageTitleNameArrayListForClick = new ArrayList<>();

Android Studio - Using Volley to get JSON data from the server

情到浓时终转凉″ 提交于 2020-01-25 06:05:20
问题 This is my first attempt to create a login system in Android Studio and already got myself into trouble with my code. My PHP script always returns something as JSON and I'm trying to parse that JSON in my LoginActivity, inside the login -method, but I'm getting the following error after creditentials were forwarded to the server and the login button was clicked: I/qtaguid﹕ Failed write_ctrl(u 43) res=-1 errno=22 I/qtaguid﹕ Untagging socket 43 failed errno=-22 W/NetworkManagementSocketTagger﹕

android volley library does not work on local IP

邮差的信 提交于 2020-01-24 19:34:06
问题 volley is not working when i want to fetch data from a system on my local network. where URL is like http://192.168.x.x/data.php it works well on emulator but not on a real device. it show a time our error. even i tried setting a maximum time our and retry policy. but in vain. 回答1: There are two ways to solve this: a) keep your device connected to the PC which is connected to your local network either using lan or wifi. Keep debugging mode on. Use ipconfig to check your pcs ipv4 address and

Getting response code 200 in Postman but not on Android Network library

三世轮回 提交于 2020-01-24 13:07:45
问题 I have a POST method API which is giving 200 response code in Postman but not when calling api by using Volley or even in Retrofit2 . Here is Postman screenshots: Here what i did for Volley library code: final String url = "http://xxxxxxxx.com/api/mobile/user/post/"; StringRequest stringReq = new StringRequest(Request.Method.POST, url, new com.android.volley.Response.Listener<String>() { @Override public void onResponse(String response) { Log.e("onResponse ===", response + " " ); } }, new com

Store Volley Request data

China☆狼群 提交于 2020-01-23 11:26:12
问题 I'm learning to program by myself and I am facing a problem which I believe is easy to solve. I'm making requests using Google Volley and like to know how I store the information coming in the request for me to work with them in my onCreate. public void parseJSON(){ StringRequest getRequest = new StringRequest(Request.Method.GET,activity.getString(R.string.URL), new Response.Listener() { @Override public void onResponse(String response) { I need to store the data for use in the method

Cleartext http traffic to server.com not permitted

北城以北 提交于 2020-01-21 07:21:04
问题 My code is working on android KitKat but it when running it in Pie gives io exception Cleartext http traffic to server.com not permitted I'm using volley to make server calls. 回答1: Simple Solution: Add this line in your manifest: android:usesCleartextTraffic="true" because I have faced the same issue with my php page for json api. It should look like this: <?xml version="1.0" encoding="utf-8"?> <manifest ...> <uses-permission android:name="android.permission.INTERNET" /> <application ...

JSON fetch dosen't work correctly in real host but work in localhost

↘锁芯ラ 提交于 2020-01-17 15:05:49
问题 I have this json in my free host : http://alibhm.epizy.com/fetch_turbine2.php As you seen fetching work correctly if run this in browser and fetch two parameter . But when put this url in my android app (with volley) don't fetch anything . In previous when I use this json in my localhost(xampp) everything work correctly but when going to free host this problem appeared dbconfig.php <?php //Define your host here. $servername = "xxx"; //Define your database username here. $username = "xxx"; /

JSON fetch dosen't work correctly in real host but work in localhost

天涯浪子 提交于 2020-01-17 15:05:24
问题 I have this json in my free host : http://alibhm.epizy.com/fetch_turbine2.php As you seen fetching work correctly if run this in browser and fetch two parameter . But when put this url in my android app (with volley) don't fetch anything . In previous when I use this json in my localhost(xampp) everything work correctly but when going to free host this problem appeared dbconfig.php <?php //Define your host here. $servername = "xxx"; //Define your database username here. $username = "xxx"; /

Not Getting data from server

北城以北 提交于 2020-01-17 05:31:52
问题 I am trying to get data from server, I have done all the coding part I am getting status code is 200 (success) but not getting data. This is my JSON data: { "status": 200, "data": [ { "id": "1", "company_id": "8", "customer_id": "17", "driver_id": null, "city_id": "2", "vehicletype_id": "4", "status": "Pending", "source_long": "77.59505250000007", "source_lat": "12.9998698", "dest_long": "77.62877609999998", "dest_lat": "12.946679", "source": "Jayamahal, Bengaluru, Karnataka, India",