Continous update the image in the activity
<p>Is there any way to continuously update the image from input stream?</p>

<p>I am implementing the client server application. Where client is android application and server is java application run on windows machine(PC). </p>

<p>The Server machine sends the image stream to client machine. For this I am using the following piece of code.</p>

<pre><code>OutputStream os=clientSocket.getOutputStream();
while(clientSocket.isConnected){
BufferedImage image = robot.createScreenCapture(new Rectangle(200,200,200,200));
ImageIO.write(image, "jpeg", os);
 os.flush();
}
</code></pre>

<p>The android client application receive the input stream and update the UI with the recent input stream.</p>

<pre><code>if(socket.isConnected){
InputStream is=socket.getInputStream();

Bitmap map=BitMapFactory.decodeStream(is);
imageview.setImageBitMap(map)
}
</code></pre>

<p>In the above case the screen displays the single fixed image.</p>

<p>where I need to update the screen continuously with the images received from server. For this I wrote following bit of code</p>

<pre><code>while(socket.isConnected){
InputStream is=socket.getInputStream();

Bitmap map=BitMapFactory.decodeStream(is);
imageview.setImageBitMap(map)
}
</code></pre>

<p>But the screen does not show at least single image also.</p>

<p>Could you please help me to sort out this.</p>
