Answer the question
In order to leave comments, you need to log in
Asynchronously loading images in a ListView using a Socket connection?
Please help me solve my problem. I am using code to load asynchronous images from this site www.technotalkative.com/android-asynchronous-image... With HTTP it works as it should, but if I change a piece when with
URL imageUrl = new URL(url);
HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection();
conn.setConnectTimeout(30000);
conn.setReadTimeout(30000);
conn.setInstanceFollowRedirects(true);
InputStream is=conn.getInputStream();
Socket socket1 = new Socket();
socket1.connect(new InetSocketAddress(mSettings.getString(APP_PREFERENCES_IPSERVER, ""), 30100), 5000);
ObjectOutputStream outp1 = new ObjectOutputStream(socket1.getOutputStream());
ObjectInputStream inp1 = new ObjectInputStream(socket1.getInputStream());
outp1.writeObject("ASprUserEdir,-,fileget,-," + url);
outp1.flush();
String messageReceived = (String) inp1.readObject();
int file_size = Integer.valueOf(messageReceived.split(",-,")[1]);
InputStream is=socket1.getInputStream();
Answer the question
In order to leave comments, you need to log in
Take a normal Glide or Picasso and you will be happy. Loading images into a list is not the most trivial thing to do.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question