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 foldercontain PNG/JPG images named in incremental numbers, such as:00001.jpg00002.jpg00003.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 folderscontain images named in numbers, starting from something like 00000.jpg or 00001.jpg and proceeding with increments of 1.

The desc.txt filedefines 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 tosuit 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 PresetYour 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, vimmsm8916_64.mk,add code:

#add for boot animationPRODUCT_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.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android 数据存储之文件存储小记
  2. Android UI设计——EditText控件
  3. android 快速入门之一 “Hello world”,以
  4. 3.EditText控件
  5. Android:BottomNavigationView设置noActio
  6. android:configChanges
  7. android 实现 搜索保存历史记录功能
  8. 在android的Browser中设置User Agent
  9. Android系列教程之四:Android项目的目录结
  10. Android JNI环境搭建及开发入门