The typical way (based on research) for saving bitmap images from a remote url is:
Bitmap bmImage = null;
InputStream in = new java.net.URL(imageUrl).openStream();
bmImage = BitmapFactory.decodeStream(in);
File file = new File(myPath);
FileOutputStream outputStream;
outputStream = new FileOutputStream(file);
bmImage.compress(Bitmap.CompressFormat.PNG, 100, outputStream);
outputStream.close();
I cannot save bitmap unless it is compressed (Bitmap is always uncompressed). The remote image size is 32KB, after compression it gets 110KB. I know I have to lower compression parameter to get smaller size, but the remote image is optimize and much more efficient.
Is there a way I can save the remote image on mobile storage without compressing it?
===== ANSWER TO MY PROBLEM =====
First I apologize for misleading content; all I wanted is to save images that could be png|jpeg|gif|etc.. Probably I mislead you guys that the image I am trying to save is in BMP format, but it is not.
Nevertheless, for those who want to save images WITHOUT compressing, have a look to this answer