Issue 3422 - android - Animated GIF not working in browser
code.google.com
code.google.com
It's a shortcoming of the graphics engine, complicated by
the relative lack of memory and the trickiness with
managing what little it has. The implementation in WebKit
for GIF support allocates a 32 bpp bitmap for each
frame, which can chew through memory very quickly. The
bitmap allocator is backed by ashmem, but when the
kernel detects low memory, it tends to kill the process
rather than giving it a chance to back off.
If you have expertise in this area, we'd gladly accept
your help in fixing this.According to the Android developer in comment 42 the explanation is that Android has multitasking while the iPhone doesn't.
function readGIF(filename) {
if (calcMemSizeNeeded(filename) > memoryFree()) {
displayGifPlaceholder();
}
}
eg just display an animated GIF if there's enough ram, and if not, display some placeholder.I guess one of the other issues there though is websites that 'stream' animated gifs that never end. Still, you could just disable those for now.
Seriously, google "OOM killer." This problem, and problems like it, are not new, nor are they simple to solve.
Also, I'm not sure where did commenter #45 get the idea about multitasking. #42 said just that process which is memory-hungry will be killed. That's it. It doesn't matter if the OS is multitasking or not... Maemo is multitasking (linux based) and displays animated GIFs just fine.
Animated gifs are so uncommon anyway (the use cases I've seen where it falls down are lolcat-worthy animations) that it's probably not worth fixing. The 90s-era gif animations probably look good enough.
The story for developers is quite poor. Emulation is very slow (you can't get close to real life snapdragon speed) and then you have Eclipse (which seems to be a hate it or love it).
I've done both iPhone and Compact Framework development, and despite objective-c, iphone development is far superior to the other two.
Anyways, these types of issues, the lack of core features like USB Host and [apparently] animated GIFs, keep making me think i should actually learn Silverlight for WM7.
For the record, I just tested animated GIFs with Opera Mobile 5 Beta on my G1 running CompleteEclair 2.0 and it doesn't do animations either.
Especially since how comment #134 on there makes the fix look kinda simple to include as an option for higher memory devices.
Which... leads us back here. Viewed in isolation it is no big deal, much as each feature of Word is no big deal in isolation. But the Android team have to deal with the combination of features running on resource-constrained handsets.
:-)
I wouldn't mind walking down the road to one of the most successful and widely loved (not to mention profitable) pieces of software in the industry.
It would take too long to numerate the demonstrations of incompetence in the Android ecosystem. I guess I'll just point out a couple:
* How about that Update All button on the market application? Oh wait, there isn't one.
* Nice next and previous conversation buttons in mail. What's that you say? Neither is available on the screen itself, and the two actions are in different parts of the menu?
* Truly impressed with that universal copy and paste. Um, about that.
Seriously folks. The phone should never have launched with these deficiencies and the many others that better people than I have noted. But to allow it to stagnate and still not address them for so long? That's flat out contempt for the user.
Also, lack of copy and paste is not a "minor" nitpick. As I recall it's one of the things that iPhone haters would not stop harping about when Android first came out with the half-baked copy and paste it still has today. (http://www.youtube.com/watch?v=ofQqhJ_fa2M) Even if that wasn't the case, it's a major, serious deficiency in the device whose absence I would miss on a fairly regular basis if I didn't have it with my iPhone.
* Copy-paste anything from the browser to elsewhere. You see how you have to go two-deep into a menu? For iPhone users, they just tap the text they want to copy, the drag to put the bounds at the right place.
* Try copying anything out of a received gmail message and pasting it somewhere else.
> that will probably leave the iPhone in the dust within about 6-12 months
If I had a dollar for every time an open source advocate claimed incorrectly that their preferred solution would leave its proprietary competitor in the dust in "just a few months," I'd have a lot of money. Not so much in the opposite direction.
Of my consumer electronics devices, about half are based on open source (appletv, nexusone, roku, linksys access point)... I don't know about my toaster, microwave, etc.
My blackberry is not, and I doubt things like tvs and dvd players are, but every day there are more benefits to companies using open source. The main threat to this is the GPLv3 license, but fortunately that's not getting too much traction.