how i can receive an image and display it with tcp socket with an android device? i tried something but don’t work. I’m searching for some example to send from pc an image or file and save it on the phone (android,java)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I use something like that to download an image from a url:
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
The way I use it is to set in the tag of the imageview, the url of the image I want to download and pass as a parameter the ImageView. Eg.
In case you want to download it using a socket you can open a socket connection like: