4

I have an animated webp file that I took from the original AR Stickers APK which I'd like to show in my app for onboarding in ARCore. It looks like I can easily load the first frame of the webp file into an imageview but trying to decode it as a Movie object fails. Is there a simple way of showing it? It's obviously possible since the AR-Stickers app clearly did it in their original release. I saw that there's a library from Facebook (Fresco) that seems like it should be able to do it but from what I understand it adds quite a bit of bloat to my app's APK. Are there any simple solutions to this?

TheHebrewHammer
  • 3,018
  • 3
  • 28
  • 45

1 Answers1

9

That's true. There aren't many animated WebP/GIF solutions out there, and Fresco takes a lot.

There is this library (made an easier fork of it here ), but it can have some serious issues with files sometimes, such as here . If you know why this occurs, and how to fix it, please consider contributing to it (or to my fork).

There is, of course, a way to use the normal Android framework for loading animation files (sample here) using ImageDecoder&AnimatedImageDrawable , but it's only from Android P.

Google has promised it will be added to the support library (here), but I still don't see it.

That's why I've created a question here, where I wanted to know how to fetch frame-by-frame image of an animated WebP file.

android developer
  • 114,585
  • 152
  • 739
  • 1,270