You can try this library, which handles a bitmap very efficiently.
https://github.com/thest1/LazyList
Its a very easy to use library of lazy lists. It caches the bitmap automatically: -
ImageLoader imageLoader=new ImageLoader(context);
imageLoader.DisplayImage(url, imageView);
NOTE:
Remember to add the following permissions for your AndroidManifest.xml: <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Create only one instance of ImageLoader and reuse it around your application. Thus, image caching will be much more efficient.and also you can look in Nostras ImageLoader, since it efficiently handles loading images into containers of a certain size, i.e. resizes and compresses them before you have to process them. It also supports uris content that will help you all right away.
, 1024x768 , 128x96 ImageView.
.
, : -
BitmapUtil.java
public class BitmapUtil {
private BitmapUtil() {}
public static int getSmallerExtentFromBytes(byte[] bytes) {
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);
return Math.min(options.outWidth, options.outHeight);
}
public static int findOptimalSampleSize(int originalSmallerExtent, int targetExtent) {
if (targetExtent < 1) return 1;
if (originalSmallerExtent < 1) return 1;
int extent = originalSmallerExtent;
int sampleSize = 1;
while ((extent >> 1) >= targetExtent) {
sampleSize <<= 1;
extent >>= 1;
}
return sampleSize;
}
public static Bitmap decodeBitmapFromBytes(byte[] bytes, int sampleSize) {
final BitmapFactory.Options options;
if (sampleSize <= 1) {
options = null;
} else {
options = new BitmapFactory.Options();
options.inSampleSize = sampleSize;
}
return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);
}
}
http://developer.android.com/training/displaying-bitmaps/index.html