// 파일의 실제 경로 찾아오기
String path = db.getImagePath(id);




BitmapFactory.Options options = new BitmapFactory.Options();
options.inDither = true;
options.inSampleSize = 6; // 이 숫자가 커질수록 사진 크기가 작아져서 속도가 빨라진다
options.inPreferredConfig = Bitmap.Config.RGB_565;


// 보통사진 -----------
bitmap = BitmapFactory.decodeFile(path, options);
// 속도가 느리다
//--------------------

// 썸네일 ------------
ContentResolver cr = getContentResolver();
int id = Integer.parseInt(uriId);
bitmap = MediaStore.Images.Thumbnails.getThumbnail(cr, id, MediaStore.Images.Thumbnails.MICRO_KIND, options);
// 썸네일은 크기가 작다.
// 썸네일의 크기가 작을 때는 그럭저럭 빠르다
// 썸네일의 크기를 원래 사진의 크기로 키우면 속도가 느려진다
//--------------------

// 회전
bitmap = UIUtil.rotate(this, bitmap, path, uriId);
imageview.setImageBitmap(bitmap);



// 좌우 스크롤시에는 이런 식으로 이동
Intent i = new Intent();
i.setClass(getApplicationContext(), this.getClass());
i.putExtra(KEY_ID, imageId);
startActivity(i);
finish();
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);




db에 폰에 있는 사진의 uri만 등록해놨다가, 해당 uri를 불러와서, 실제 경로의 사진을 가져오는 예제를 작성하고 있습니다.

근데 문제는 속도가 너무 느립니다...

기본 갤러리 앱이나, 구글코드에 공개된 소스는 속도가 무척 빠른데, 제가 만든건 엄청 느리네요....


QuickPic을 보니까 미리보기 캐시를 사용한다해서 검색해봤는데, 예제 소스 찾기가 힘드네요 ㅠㅠ



좋은 방법 없나요? ㅠㅠ