There are two types of boot animation in Android: Default Android text display and Custom Animation. The main implementation code is in \ frameworks \ base \ cmds \ bootanimation. The following describes how to add a custom boot Animation:
Automatically enable animated images and package the images to be displayed into a bootanimation.zip file. Put it in the "/data/local/" or "/system/Media/" directory of the mobile phone. When the camera is turned on, the system will check whether the two directories contain the bootanimation.zip file. If not, use the default Android boot animation.
The structure of the bootanimation.zip file before packaging is:
Desc.txt animation attribute description file
Part0 first-stage animation image directory (the animation consists of a frame image)
Directory of the second-stage animation image of Part1
The bootanimation.zip file is directly packaged by these files. The package format is zip and the compression and packaging method must be specified (that is, the compression method selected as storage during packaging ).
The format of the desc.txt file is:
480 250 15
P 1 0 part0
P 0 10 Part1
The meanings of parameters are as follows:
480 250 15
The number of frames displayed per second in the height of a wide image.
P 1 0 part0
The Directory of the image corresponding to the number of times of the identifier loop phase switching Interval
P 0 10 Part1
The Directory of the image corresponding to the number of times of the identifier loop phase switching Interval
Identifier: P is required.
Number of cycles: the number of times the images in the directory are displayed cyclically. 0 indicates an infinite loop in this phase.
The number of frames per second: the number of images displayed per second, which determines the time when each image is displayed.
Phase switching interval: it refers to the interval at which an image of the next phase is displayed after the end of the phase. The unit is the time when each image is displayed.
Directory of the corresponding image: it is the series of animation at this stage. The animation is displayed in order of the image file directory, and the image format must be PNG.