[Android General] Harshraj:
A Guide To Support My Other Thread On How To Create Boot animations So It Is Easier For People To Understand And Grasp The Concept.

so they will ask less questions :P XD

Hit thnxx if u like this guide friends !

CONTENTS

The Basics

Inside the bootanimation.zip file

Featured Boot Animations

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Basics :

The Android boot animation is contained within a an uncompressed zip file called bootanimation.zip that can be found in the media folder of the system partition i.e. /system/media on the internal memory of the device. This single file contains all the information required to play the boot animation, and is loaded automatically when the device boots. Thus, customizing or changing the boot animation is simply the process of editing or replacing this file.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Inside The Bootanimation.Zip File

This section is for those interested in finding out how the Android boot animation works. If you just want to install one without bothering yourself about what’s in the file, feel free to move on to the next section, as this one will get a little technical. Though it should be easy and simple enough for anyone to grasp.

While the Android boot animation might appear to be in a video format during playback, it is in fact a little different. If you extract the contents of the bootanimation.zip file to your computer, you will see:

A desc.txt file

A part0 folder (Contains PNG images named in incremental numbers)

More part1, part2 etc. folders (May or may not be present)

As you can see, bootanimation.zip merely contains one text file and one or more folders with PNG images. The animation is played simply by displaying the images in a sequence, and the text file defines how they are to be played. In essence, first the PNG files in the part0 folder are displayed one after the other and afterwards, those in the part1 file – if it exists – are displayed, again one after the other, and so on. All of this is defined in the desc.txt file.

Let’s see how it works in a little detail by taking a closer look at the contents of the file.

The folders

These contain PNG images named in numbers, starting from something like 0000.jpg or 00001.jpg and proceeding with increments of 1. There has to be at least one folder, and there is no known upper limit to the number of folders.

The desc.txt file

This file defines how the images in the folder(s) are displayed during the boot animation, in the following format:

Width Height Frame-rate

p Loop Pause Folder1

p Loop Pause Folder2

An example of a desc.txt file is:

320 480 30

p 1 0 part0

p 0 0 part1

As you can see, in the first line, 320 and 480 define the width and height of the boot animation in pixels for this example. This must be the same as the screen resolution of your device for the boot animation to properly play in full screen. 30 is the frame rate in fps (frames per second) i.e. number of images to display per second.

The second and third lines have a same format, start with p, which stands for a part of the animation and end in part0 or part1, which denotes the folder in which the images for that part are present.

The number after ‘p’ defines how many times this part will loop (repeat playback) before switching to the next part (if present). Specifying 0 would make the part loop indefinitely till the phone has fully booted.

The next number is for the pause, and is expressed in the number of frames, which can be translated into time by dividing it by the frame rate. A pause of 15 for example, would mean pausing for the time it takes 15 frames to play and since the frame rate is 30 frames per second, 15 frames would take half a second.

Translating all of this in case of the above example, the boot animation will play at a resolution of 320 by 480 pixels, at a frame rate of 30 fps, starting with the contents of part0 folder and after playing them in one loop, switching to contents of part1 folder and playing them continuously till the device fully boots. :p

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------