dcostinett / and-bookworm

Automatically exported from code.google.com/p/and-bookworm
0 stars 0 forks source link

Change to BitmapFactory and encode/decode handling to consume less memory #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From submitted results

"java.lang.OutOfMemoryError: bitmap size exceeds VM budget
  at android.graphics.BitmapFactory.nativeDecodeStream(BitmapFactory.java:-
2)
  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)
  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:515)
  at com.totsp.bookworm.BookForm.onActivityResult(BookForm.java:194)
  at android.app.Activity.dispatchActivityResult(Activity.java:3828)
  at 
android.app.ActivityGroup.dispatchActivityResult(ActivityGroup.java:123)
  at android.app.ActivityThread.deliverResults(ActivityThread.java:3325)
  at android.app.ActivityThread.handleSendResult(ActivityThread.java:3371)
  at android.app.ActivityThread.access$2700(ActivityThread.java:119)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1893)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4363)
  at java.lang.reflect.Method.invokeNative(Method.java:-2)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
860)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  at dalvik.system.NativeStart.main(NativeStart.java:-2)"

Original issue reported on code.google.com by charlie....@gmail.com on 28 May 2010 at 3:53

GoogleCodeExporter commented 9 years ago
Use inSampleSize -- 
http://stackoverflow.com/questions/477572/android-strange-out-of-
memory-issue.

Original comment by charlie....@gmail.com on 28 May 2010 at 3:53

GoogleCodeExporter commented 9 years ago
I did this and drastically reduced the quality. Also we are dealing with very 
small 
images. Therefore I kept as is, but added some net timeouts and other error 
handling 
in that same area. 

Original comment by charlie....@gmail.com on 1 Jun 2010 at 12:28