Android How To Load/save Original Size Bitmap With No Outofmemory
I read many discussions about the inSampleSize OutOfMemory dilemma. Cannot get a good solution so i ask a question about it. Im currently loading a bitmap with inSampleSize=4. That
Solution 1:
Image processing requires a lot of memory. you cant use the whole bitmap and just modify it on your phone. use a web service for that. upload, process, download. sorry there is no other way a decoded bitmap just takes a lot of memory.
And by the way you cant catch an outOFMemory Exception. the app just crashes.
Solution 2:
There's a hard limit on process size in Android and a 4 mega-pixel image at four bytes a pixel will hit it all by itself (on many devices), without any room for your program.
I think you are going to need to do one of two things: Create a web service to do the image processing on a server/in the cloud; or learn to do your image processing "on-the-fly" by manipulating the data directly instead of using a bitmap.
Post a Comment for "Android How To Load/save Original Size Bitmap With No Outofmemory"