Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
This is a duplicate of "Why a I getting out of memory error exception on Android?"
-
all seriousness asiade, use BitmapFactory.decodeStream() or use a BitmapFactory.Options and set BitmapFactory.Options.inSampleSize = 4;
-
@calmyourtities
hahahaha
you must think I'm some fucking genius to even begin thinking where to put that code...
I'm a ninth grader bro, I'm like on my way trying to teach myself, I appreciate the help, but is there anyway you can explain why, and then also tell me where to put this, even though I suspect it's the class file in android studio but I don't feel like effing up this project so soon. thanks man. -
Ezard19607yI mean if the image is so big that it crashes Android Studio then it's probably so big that it'll crash any Android device, so you might want to consider scaling it down in Photoshop/Gimp/paint.NET/etc
-
@coolguy101 I'm in ninth grade too, and it's because of the buffer size. the buffer is memory where the image is stored, so, for example, if the image is 120 bytes, but the buffer is 100 bytes, then the buffer couldn't store the image, just like how you can't store a 10 gb file on an 8gb flash drive. so, you have to manually increase the buffer size to compensate for the size of the image. I'm kinda busy right now, but later I can show you some samples from my apps.
-
what @Ezard is trying to say, is that you can't make a buffer big enough for the size of the image you said
-
Exactly what @calmyourtities said.
With a loop to see what sample size is needed.
If you don't know where to put it, go to Android developer site it's full of examples.
Related Rants
Anyone know how to get by the "Out of Memory" error on Android Studio when an image you have is like 102941092301mb too big and it crashes your app when you debug?
pls I need help, this image looks terrible when it isn't the resolution I would like...
undefined
idk what else
java
android studio