ArrayList에 있는 URL이미지 주소를 List에 뿌리는 겁니다.

 

그런데.... 너무 느립니다.

 

아래의 메쏘드를 봐주시고... 뭐가 문제인지.. 왜 속도가 안나는지... 좀 봐주시기 바랍니다.

String url;
 while(ArrayList만큼)
          url = ArrayList[index].toString(); //http:~~~.png 문자열이 있음
            img.setImageBitmap(urlTobitmap(url, 4));

 public static Bitmap urlTobitmap(String _photoURL, int _size) {
  URL url = null;
  Bitmap bitmap = null;
  try {
   url = new URL("_photoURL);
   HttpGet httpRequest = null;
   try {
    httpRequest = new HttpGet(url.toURI());
   } catch (Exception e) {
    e.printStackTrace();
   }
   HttpClient httpclient = new DefaultHttpClient();
   HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
   HttpEntity entity = response.getEntity();
   BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
   InputStream instream = bufHttpEntity.getContent();
   
   BitmapFactory.Options options = new BitmapFactory.Options();
   options.inSampleSize = _size;
   
   bitmap = BitmapFactory.decodeStream(instream,null,options);
  } catch (MalformedURLException e) {
   e.printStackTrace();
  } catch (IOException e) {
   e.printStackTrace();
  }
  return bitmap;
 }

 

일종의 튜닝을 부탁드리는 겁니다. 

 

웹이미지를 이렇게 많이뿌리는 앱을 본적이 없어서 지금의 속도가 정상인지 아닌지 모르겠습니다만...

 

한 페이지에 약 30개의 웹 이미지를 뿌리는데 4.5초정도 거릴는듯 합니다.

 

고수님들 한번 확인 부탁 드립니다.