Where Customization Begins 

  • Android Bootanimation File Explained (Bootanimation.zip)

 #20920  by Neuropass
 28 Dec 2011, 00:31
In 2.0, the android boot animation has been changed to enable easy replacement or customization.

There is a file called bootanimation.zip stored in /system/media/ in the root file system (or /data/local). This file contains two things:

1) A description file (desc.txt) that outlines how the animation progresses, what images to use, image size etc.
2) Folder(s) that contain the images for the animation.

The basic structure of the bootanimation.zip file is as follows:

bootanimation.zip
|-- desc.txt
|-- part0
`-- part1


part0 and part1 are directories that contain a series of images for example, in part 0 there is:

part0
|-- boot_00001.png
|-- boot_00002.png
|-- boot_00003.png
|-- boot_00004.png
|-- boot_00005.png
|-- boot_00006.png
|-- boot_00007.png
|-- boot_00008.png
|-- boot_00009.png
`-- boot_00010.png

And in part 1 there are:

part1
|-- boot_00011.png
|-- boot_00012.png
|-- boot_00013.png
|-- boot_00014.png
|-- boot_00015.png
|-- boot_00016.png
|-- boot_00017.png
|-- boot_00018.png
|-- boot_00019.png
`-- boot_00020.png

These images form the 'part0' and 'part1' animations that are combined as outlined in the 'desc.txt' file to form the overall startup animation. The images are ordered by number and run in sequence.
The 'desc.txt' file outlines how the animation progresses and a sample is as follows:

512 256 30
p 1 0 part0
p 0 0 part1

'523' is the width of the animation
'256' is the height of the animation
'30' is the desired fps of the animation
'p' defines a animation part
'1' how many times this animation part loops
'0' defines a pause (max 10)
'part0' is the folder name where the animation images are
'p' defines another animation part
'0' defines that it loops forever (until android starts)
'0' defines a pause
'part1' is the folder for the second animation part.



How to:


Getting the files ready

1. First create your animation. I usually use Flash.

2. Once you are happy with it you need to turn it into a series of png files. In flash goto [File > Export > Export Movie] then choose "PNG Sequence".

3. Next you have to rename the png files. i use "better file rename" for this (eg. "animation_00001.png", "animation_00002.png")

Making the bootanimation.zip

1. First make two folders "part0" and "part1" (you can call them anything, but its easier to explain this way)
(part0 is for animation that plays once, part1 is for animation that loops untill the device is loaded.)

2. Now make a text file "desc.txt" and enter something like this:

"320 480 30p 1 0 part0p 0 0 part1" - G1 example

"480 800 30p 1 0 part0p 0 0 part1" - N1 example

3. Once you have that done its time to turn it into a zip. I use Winrar for this. Make sure you call it bootanimation.zip and there must be No Compression. The zip is just for storage.

It should look like this:
bootanimation.zip -

> part0
> part1
> desc.txt

4. After that just push via adb to /system/media (i think /data/local also works)

Explanation of the "desc.txt"

Originally Posted by Tzira


320 480 15
p 1 150 android
p 50000 1 last

First line contains 3 numbers width, height and fps

Second line (and any succesive lines) starts with the letter "p" (which comes from animation part) and contains 3 items:

-count: number of time this part is repeated

-pause: number of microseconds to pause after the last frame of the part

-path: the directory which contains the png files that compose the frame of this part




Source:Here.