8

I want to play APNG files and create animated stickers in my app like LINE messenger! I can create apng using some tools like APNG Assembler. but I dont know how to play animated png in my app.

help me please!

farhad.kargaran
  • 2,233
  • 1
  • 24
  • 30
  • Hello! Have you found any solution? If so, what method / library do you use? I use https://github.com/sahasbhop/apng-view but it's not going very well if you load a lot together. @farhad.kargaran – UserNameYo Apr 23 '18 at 14:14

1 Answers1

3

If you want to display or create apng files you could use this : https://github.com/oupson/Kapng-Android

Example of loading apng file into imageView :

ApngDecoder.decodeApngAsyncInto(context, URL("https://apng.onevcat.com/assets/elephant.png"), imageView)
oupson
  • 31
  • 1
  • 6
  • how can you check if one file is APNG ? before loading it? – ghita Mar 02 '22 at 08:19
  • 1
    APNG are PNG with extra chunks. You may not want to check before loading it, as it require to go through the file and to check the existence of an apng chunk. Instead, you can load your PNG files with the library, as it support PNG and APNG. If you really want to check, there is a function to do that : isApng, but it is deprecated. – oupson Mar 04 '22 at 09:39