Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animated splash screen using .gif

I want to use animated gif for the Splash screen. So I change the src in config.xml into my gif like this:

...
<gap:splash gap:density="xhdpi" gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.gif" />
...

But when it runs, the gif image is not animating and only show the first frame.

I have another gif inside the app and it animates well. So I guess the one in splash screen is not WebView?

Is there a way to use gif for splash screen other than customizing the Android Java code?

Thanks

like image 342
hrsetyono Avatar asked Nov 14 '13 01:11

hrsetyono


2 Answers

In webview .gif works well. In other cases it does not work in android. You need to customize android java code to make it work. But their is an alternative.

If you have the images for all frames (you may also extract them from gif) and use android animation on the images. It will look like gif image only. All i mean is that you can do frame anmations.

This link will give you some idea:

http://mobile.tutsplus.com/tutorials/android/android-sdk-quick-tip-creating-frame-animations/

You may google more to find better tutorial. This kind animation works very well.

like image 79
Sushil Avatar answered Sep 28 '22 05:09

Sushil


You may be able to use a Movie instead of a WebView. That class is not well-documented but someone was nice enough to make a walkthrough, albeit one that isn't specific to splash screens:

http://weavora.com/blog/2012/02/07/android-how-to-use-animated-gif/

I'm not sure if this meets your "other than customizing the Android Java code" requirement, though.

like image 27
JaneGoodall Avatar answered Sep 28 '22 03:09

JaneGoodall