public class Tttttt extends Activity {
public static final String SERV_IP = "xxxxxxxxxxxxxxxx아이피주소";
public static final int PORT = xxxx포트번호;
ViewFlipper flipper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Socket sock=null;
try {
ImageView downimage = (ImageView)findViewById(R.id.imageView1);
sock = new Socket(SERV_IP, PORT);
InputStream in = sock.getInputStream();
Bitmap bitmap = BitmapFactory.decodeStream(in);
downimage.setImageBitmap(bitmap);
downimage.setScaleType(ScaleType.FIT_XY);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
sock.close();
} catch (IOException e) {
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.ttttt, menu);
return true;
}
}
//////////////////////////////
위에 소스를 가지고 이미지 출력되는 부분을 계속 갱신시켜주고 싶은데
이거 어떻게 하는지좀 알려주세요
만약 for문이나 while문을 써야한다면 어떻게 쓰는지 알려주세요
invalidate()를 사용할수있는지도 알고싶네요