android-volley

EOFException after server responds

你说的曾经没有我的故事 提交于 2019-12-13 05:19:49
问题 I have a quite simple problem but I've still couldn't find a solution yet. What I want to accomplish: I'm trying to establish a reliable connection between a smartphone running Android and the ESP8266 wifi module. I would like to send short HTTP string messages, where the phone plays the role of a client and the ESP8266 of a server. For managing HTTP requests I'm using the Volley library. What already works: I am able to do a successful HTTP GET request to the ESP8266 from a browser running

Why is Volley returning null value for response object

馋奶兔 提交于 2019-12-13 05:18:02
问题 Here is my onResponse method public void onResponse(SongInfo response) { Log.v("TAG", "Response value is "+String.valueOf(response.artworkUrl30)); // Prints "Response value is null" } String.valueOf(response.artworkUrl30)) should return a URL Here I set up my request queue singleton Static `mRequestQueue` variable and method public static RequestQueue mRequestQueue; public static RequestQueue getRequestQueue() { if (mRequestQueue == null) { mRequestQueue = Volley.newRequestQueue(MainActivity

How to send an image downloaded by volley to the next activity

偶尔善良 提交于 2019-12-13 04:58:28
问题 I am using volley to download images and text on a listview in my activity. On clicking a row i pass both the image and the text to Details activity . On details activity i would like to pass only the Image to yet another activity. After research on S/O i found a code that works: BitmapDrawable bd = (BitmapDrawable) ((NetworkImageView) view.findViewById(R.id.img2)) .getDrawable(); Bitmap bitmapzoom=bd.getBitmap(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bd.getBitmap()

Handling a JSON Response

不羁岁月 提交于 2019-12-13 04:54:57
问题 I have Asp.net Api to get JSON response like this: {\"UserID\":5,\"UserName\":\"asd\",\"Password\":\"asd\",\"Email\":\"ss@asd\",\"PhoneNumber\":\"1213\",\"Logtit\":0.0,\"Latitle\":0.0,\"OfGroup\":\"a \"} How can I handle this JSON response in Android Studio Using Volley Lib? This is my code: public class MainActivity extends AppCompatActivity { RequestQueue requestqueue; Button start; TextView textView; EditText ee; public String givenValue = ee.getText().toString(); public String URL = "http

Can't authenticate with Monzo's API using Volley

前提是你 提交于 2019-12-13 03:59:43
问题 I'm trying to get the authentication token from Monzo as in the section 'Exchange the authorization code' in the docs. When I make the request using httpie from the terminal I have no problem, but when I make the request using Volley I get a 400 response. I've confirmed that I'm using Volley correctly using the https://postman-echo.com/post endpoint. Does the following use of Volley look sensible? VolleyLog.DEBUG = true; val jsonBody = JSONObject() jsonBody.put("grant_type", "authorization

How to refresh Volley caching

烂漫一生 提交于 2019-12-13 03:56:55
问题 I have enabled Volley caching to view data in offline mode also. JSON data is updated with certain time period. But I can't update new json data with SwipeRefreshLayout . If I removed Volley caching code, data is refreshed. I want to expire old cache and load new cache while clicking refresh button. I have the following code to refresh. mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout); mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout

Display BLOB image from mysql to android using volley (json encoded)

孤街醉人 提交于 2019-12-13 03:56:09
问题 Seniors please help me my code mentioned below, this code is able to shows only text data but never image please help me. i want to show also image with text data but i am fail. basically i am using recycle view to show MySQL data with blob image. please help me php code <?php if ($_SERVER['REQUEST_METHOD']=='GET') { include 'DatabaseConfig.php'; // Create connection $conn = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname); //Checking if any error occured while connecting // Check connection

Loop through values of a JSONArray in php

前提是你 提交于 2019-12-13 03:45:06
问题 I have 3 arrayLists in android app. I am sending them to php via android volley POST request like: public RequestPostBook(long id, ArrayList<String> bookNames, ArrayList<String> bookAuthors, ArrayList<String> subjects, String date,Response.Listener<String> listener) { super(Method.POST, REGISTER_REQUEST_URL, listener, null); JSONArray bookNamesJSON = new JSONArray(Arrays.asList(bookNames)); JSONArray bookAuthorsJSON = new JSONArray(Arrays.asList(bookAuthors)); JSONArray subjectsJSON = new

BasicNetwork.performRequest: Unexpected response code 500 for Volley

醉酒当歌 提交于 2019-12-13 03:44:56
问题 i am trying to create a user login page, i am getting this error while i try to register.I guess there is a problem with the Json object part.I tried searching for other answers in the forum but none of seem to address my problem. Request you to help me out with this. Thanks is advance. public void registercheck(final String name, final String email, final String password) { String tag_req = "Register_request"; pdialog.setMessage("Registering ..."); showDialog(); StringRequest strR = new

Insert data into mysql db with php script doesnt work

十年热恋 提交于 2019-12-13 03:29:55
问题 Hello developers out there, I am trying to insert data from my Android Application into my MySql Server (running on wamp) with php script. Thhose are my php scripts: <?php define('hostname','localhost'); define('user','root'); define('password',''); define('databaseName','tutorial'); $connect = mysqli_connect(hostname,user,password,databaseName); ?> AND <?php if($_SERVER["REQUEST_METHOD"]=="POST") { require 'connection.php'; createStudent(); } function createstudent(){ global $connect;