问题
I want to send byte [] to make a request and in the response i will get the byte[].So can you please help me.
Right now i am using the Asynctask doInBackground() for the network call and Socket class.
Had gone through some link but could not found the solution. Thanks in advance.
回答1:
Seems Volley is a http library, see this. It's good enough to use AsyncTask for this.
Edit
Kryonet is another very good Java network library for sending TCP and UDP packets over network efficiently which runs on Android as well. Though whenever I used Kryonet, I wrote both the server side code and client side code using this library. Kryonet keeps the connection alive though, so if you don't have any issues changing your server side code from Python to Java (Kryonet has samples which you can use), then it will serve your purpose well. Using this library, you don't even need to hardcode any IP address. You can discover the local server in real time with just one line of code.
Quoted from here
来源:https://stackoverflow.com/questions/39344438/how-to-use-volley-library-for-network-call-using-socketip-address-and-port-num