gif animations in android mode

edited May 2014 in Android Mode

hi all, i would like to work with gif animations in android mode i am using the gif animation library by extrapixel: https://github.com/extrapixel/gif-animation which works fine in processing on my computer, but crashes when i try to run it on my tablet can someone help, plz? thanks! /j

this is my code

import gifAnimation.*;

Gif loopingGif;

public void setup() {
  size(400, 200);

  loopingGif = new Gif(this, "lavalamp.gif");
  loopingGif.loop();
}

void draw() {
  background(255);
  image(loopingGif, 10, 10);
}

and this is my error msg in the console

FATAL EXCEPTION: Animation Thread java.lang.NoSuchMethodError: processing.core.PApplet.openStream at gifAnimation.Gif.createInputStream(Gif.java:141) at gifAnimation.Gif.createDecoder(Gif.java:169) at gifAnimation.Gif.(Gif.java:64) at processing.test.gifdisplay.gifDisplay.setup(gifDisplay.java:36) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source) at processing.core.PApplet.run(Unknown Source) at java.lang.Thread.run(Thread.java:838)

Answers

  • I haven't looked to see what causes this error, but it is probably an incompatibility with Android mode. As far as I can tell, the library page doesn't explicitly support Android mode. Your best bet would be to contact the library's author directly (unless they happen to browse this forum). It may be an easy fix...

  • "openStream"
    The GifAnimation library tries to open the Gif file using this method, but it is not available in Android mode, which probably needs more "ceremony" (has more restrictions) to open a file.

  • hey, thanks for the quick replies! PhiLho, what do you mean by "openStream" and "ceremony"?

  • By "ceremony" I guess he meant bureaucracy & boilerplate redundancy! :!!

  • edited May 2014

    openStream can be seen at the top of the error message you report. It is used to open files. By ceremony, I mean you need extra care to open files, asking it gently to the system (needing some special rights), being restricted to some areas, etc.

  • edited August 2014

    Hi, I am in the same situation as jsr606 and I was wondering if there was a workaround to display gif animations in Android using this library.

  • i have the same question as well, how can we display gif animations in android?

  • I suppose there's no way to display gif animations using the gifAnimation library, as it uses java.awt.image.BufferedImage which is not supported by the Android SDK.

Sign In or Register to comment.