I'm new to Android so I'm not getting exactly how to make my application more responsive as it creates bitmaps for each processing and set to imageView.Basically What i'm trying to do is that create a bitmap, play with it,like passing values from seekBar to change its properties and set it to imageView.How to create a Copy of Bitmap object to avoid references.Any Suggestions ?? Thanks in advance
2 Answers
Use Lazy loading and Image loader classes in android to set image on imageView so it will look like more responsive Here is some tutorial links for this

- 4,499
- 3
- 19
- 20
You can try this library which handles bitmap very efficiently.
https://github.com/thest1/LazyList
Its very easy to use this lazy list library.
It does the job of caching bitmap automatically:-
ImageLoader imageLoader=new ImageLoader(context);
imageLoader.DisplayImage(url, imageView);
NOTE :
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
and also you can look into Nostras ImageLoader, as it efficiently handles loading images into specific sized containers, i.e resizing and compressing them, before you will need to handle them. It also supports content uris which will help you all at once.
Besides this,it’s not worth loading a 1024x768 pixel image into memory if it will eventually be displayed in a 128x96 pixel thumbnail in an ImageView. You should load a scaled down version of image into memory. I am also sharing wonderful utility class for bitmap which helps you to scale down your image according to size:-
BitmapUtil.java
/**
* Provides static functions to decode bitmaps at the optimal size
*/
public class BitmapUtil {
private BitmapUtil() {}
/**
* Returns Width or Height of the picture, depending on which size is smaller. Doesn't actually
* decode the picture, so it is pretty efficient to run.
*/
public static int getSmallerExtentFromBytes(byte[] bytes) {
final BitmapFactory.Options options = new BitmapFactory.Options();
// don't actually decode the picture, just return its bounds
options.inJustDecodeBounds = true;
BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);
// test what the best sample size is
return Math.min(options.outWidth, options.outHeight);
}
/**
* Finds the optimal sampleSize for loading the picture
* @param originalSmallerExtent Width or height of the picture, whichever is smaller
* @param targetExtent Width or height of the target view, whichever is bigger.
*
* If either one of the parameters is 0 or smaller, no sampling is applied
*/
public static int findOptimalSampleSize(int originalSmallerExtent, int targetExtent) {
// If we don't know sizes, we can't do sampling.
if (targetExtent < 1) return 1;
if (originalSmallerExtent < 1) return 1;
// test what the best sample size is
int extent = originalSmallerExtent;
int sampleSize = 1;
while ((extent >> 1) >= targetExtent) {
sampleSize <<= 1;
extent >>= 1;
}
return sampleSize;
}
/**
* Decodes the bitmap with the given sample size
*/
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);
}
}
also You can go to this link It will help you to build the app
http://developer.android.com/training/displaying-bitmaps/index.html

- 3,473
- 1
- 29
- 47