Does anyone else have a issue with displaying File image in a gridview.builder or list? The images display but if I scroll fast logcat gives an out of memory exception and the app crashes.
I have tired clearing the cache, that doesn't help. Memory used by the app when you get out of memory varies, sometimes 100mb other times 500mb.
I have tried an example to rule out anything daft in code I'm doing by using someone else's example https://github.com/follow2vivek/FlutterGallery but still have the same issue when you scroll up and down fast.
I only have 18 pictures. I have tried a few phones too.
Related
I'm using a RecyclerView with images (approx 140 items in the list).
I had memory issues before so I removed the images from the view completely, before I put the APP live.
Now I am using Picasso to load the images, but before I upload this new version to the PlayStore, I'd like to be confident that this has fixed the memory issue? The new phone I'm using to test this on has a lot more memory than my previous phone, so I cannot reproduce the original problem anymore.
I am resizing my image to match my screen width.
I've written a Unity3D game and installed on Android. The game often, but not always, crashes during an operation to load a collection of image resources used by my game. Specifically the application disappears into the background and when I select it, it then restarts. At the moment I can't figure out what is causing this behaviour, I've examined logcat logs when this happens but I can't find any message telling what has happened.
Has anyone experienced similar behaviour and if so what was the solution? Is there a way of finding out why the game has crashed or increase memory allocated to it in case the game is running out of memory loading the images?
The size of images and the compression rate are configurable in the Unity IDE, and can change between platforms. In Unity 5, as a default the max size for an image is 2048 or 4096, which are not fully supported in all devices. I suggest as a first solution to go to the Unity project, select the image assets, scroll down to the setting box for each image, click on the Android tab, check the box marked "override for Android", and change the max size to 1024.
Apply the change, play test to confirm the image is still sharp enough, and re-build the game. I believe this may help you solve the issue.
I have a webview which opens a page that shows different images like a gallery.
The image is saved locally on an sdcard and is loaded through css with background-image: url(file://...).
This issue seems (not sure though) to be connected to Android's request for resources for some reason. The longer the OS needs resources the bigger the white (or black) band is.
This doesn't happen always in one test session and affects images randomly (in a cycle a certain image displays ok, in the next it doesn't). Also it seems to affect only images, displaying an iframe is always loaded normally.
I wouldn't have a problem if this happened for one second and then it would display normally, the problem is that the image stays like that until the next refresh of the webview.
android's version is 4.4.2. It is a mk808b plus device if any of this helps...
Any ideas on how to solve or somehow decrease the times this happens... anything really... except using imageview, I want to keep all in the webview. Any directions to follow for further debugging are also greatly appreciated.
Thank you for any help you can provide.
If it is possible I would try converting background images to a vectorial format (like SVG). Rendering should be easier and less memory hungry.
My application uses far too much memory, and uses a lot of images on one of the activities. I went to my main menu which only has 2 image buttons and a background image and removed all of the images from it to see what kind of memory it used... It still seems pretty high for nothing on the page.
http://imgur.com/6pfNlxf
Any idea what I'm doing wrong? Or are these normal numbers? In the activity that uses a lot of images, the allocated memory is much higher around 250MB, and crashes if I don't use my tiny scaled down images.
I'm downloading profile pictures from the web and storing them on the sd card. I load the images into a list. For the most part it works. I have about 300 images in my test data and out of those only about 3 fail to decode when using BitmapFactory.decodeFile. If I copy the image off the phone to a computer the image will render fine.
I'm thinking that these images may be partially corrupt and the computer just ignores the corrupt part and continues rendering. If this is the case, is there some way to force the same thing on android?
I'm not really sure why this is failing, so if you think it is some other problem, please let me know.
Thanks!
Do you have any exceptions coming up? These types of decode operations are prone to crashes on Android and you'll get OutOfMemory exceptions which may be why you don't see the image rendered.