How To Make Bootanimation (Base on Android Source Code)

What Is BootAnimation??

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. When device boot up,/system/bin/bootanimation will extract pictrue from bootanimation.zip and play the animation.

What a Bootanimation.zip Contains??

If you extract the bootanimation.zip, you will see:

1) A desc.txt file
2) A part0 folder, more part1, part2 etc. folders (May or may not be present, these folder contain PNG/JPG images named in incremental numbers, such as: 00001.jpg 00002.jpg 00003.jpg)

Boot animation is played by displaying images in a sequence, and desc.txt file defines how they are to be played. In essence, first the PNG/JPG 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.

What Each Files And Folder Does??

The folders contain images named in numbers, starting from something like 00000.jpg or 00001.jpg and proceeding with increments of 1.

The desc.txt file defines how the images in the folder(s) are displayed during the boot animation, An example of desc.txt file:

720 1280 15
p 1 0 part0
p 0 0 part1

Formart:

Width Height Frame-rate
p Loop Pause Folder1
p Loop Pause Folder2

In the first line, 720 and 1280 define the width and height of the boot animation in pixels.15 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 15 frames per second, 15 frames would take a second.

Translating all of this in case of the above example, the boot animation will play at a resolution of 720 by 1280 pixels, at a frame rate of 15 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. 

Create Your Own BootAnimation

Creating PNG/JPG images to suit your device. Modify the desc.txt file, then compress these file and folder to bootanimation.zip.

Test Your BootAnimation

1) Pushing the bootanimation.zip to /system/media

2) adb shell

3) cd /system/bin

4) ./bootanimaiton

You can check your boot animation without reboot your device.

How to Preset Your BootAnimation

If you are a Android source code compiler, you can preset your boot animation as default.Steps as below:

1) Create your own bootanimation.zip

2) Move the bootanimation.zip to /vendor/qcom/msm8916_64 or another patch.

2) Modify the project make file. i.e. cd vendor/qcom/msm8916_64, vim msm8916_64.mk,add code:

#add for boot animation
PRODUCT_COPY_FILES += device/qcom/msm8916_64/bootanimation.zip:system/media/bootanimation.zip \
                      device/qcom/msm8916_64/boot.wav:system/media/boot.wav
boot.wav is a boot up sound.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值