Android system porting and debugging-------> How to modify the boot animation two ways to dissect "go"

Source: Internet
Author: User

This article was reproduced from: http://blog.csdn.net/ouyang_peng/article/details/9564753

First, let's analyze the source code first:

Frameworks/base/cmds/bootanimation/bootanimation.cpp

First look at the defined constants:

Bootanimation::readytorun ()

Enter an IF Judgment statement

Bootanimation::threadloop ()

==> bootanimation::android () will load "images/android-logo-mask.png" and "Images/android-logo-shine.png"

==> Bootanimation::movie () loads the contents of the Bootanimation.zip

We downloaded the source code in the default is not those of the. zip animation, so always jump to the Android font flashing screen

So if you're using a. zip animation, copy the animation you made to the corresponding directory, and then execute make Snod to integrate into the IMG package to see the effect.

If you want to change the two images of Android flashing, the simplest way is to replace the image directly, and if you know OpenGL, you can make your own cool animations.

The two pictures are placed in the./frameworks/base/core/res/assets/images directory, a skeleton Android image, a luminous effect, the animation effect is the next one of the glowing moving around.

Method 1:

Modify ~/mx0831-0525/frameworks/base/core/res/assets/directly The picture in the images directory (this animation was synthesized by android-logo-mask.png and android-logo-shine.png).


Method 2: (Reproduced in: http://blog.csdn.NET/mlbcday/article/details/7410509)

Android Boot Animation has two methods of modification, Android 2.0 and later, using the Bootanimation program display boot screen, if you need to modify the boot screen, do not modify the code, just according to the format required to do Bootanimation.zip package, put in the system/ System/media directory, or in the/data/local directory, two directories are present, priority is given to using/data/local. Before Android 2.0, you need to modify the source code.

  The boot screen is mainly composed of a zip-format compression package Bootanimation.zip, the compressed package contains several PNG-formatted pictures, there is a desc.txt text document, when the boot press desc.txt inside the instructions, the screen will be in the order of the file name sequence of continuous play a picture, like playing the original The beginning of the tape film, the formation of animation.
(1) animated picture production. Due to the lack of a source file for the horizontal screen animation, this example uses a screen recorder software to record a horizontal screen boot animation in the Android emulator (such as a screen recorder expert V2011), and then captures each frame (such as KMPlayer) in the media Player and saves the picture in PNG format. The use of these two software is relatively simple, you can refer to the online instructions.   According to personal preferences, if the replacement of other animation methods are similar, such as using Flash to create their own desired animation, by frame export, and then in numerical order to the file number is OK.            
The picture is placed in a single folder after the number number, in this case, part0. such as:

The Android platform scans the image by default, so you need to rotate the picture clockwise once.

(2) Animation property description file. Desc.txt is a file saved in ANSI format for setting this animation pixel (size), number of frames, flashing times, folder name, etc. The contents are as follows:
480 427 30
P 1 0 part0
P 0 0 Part1

480 427---Here 480 represents the pixel (size) width of the picture, 427 represents the pixel (size) height of the picture, and 30 represents the number of frames;
P 1 0 part0---Here the p represents the marker, 1 for the number of cycles 1 times, 0 for the stage interval of 0,part0 for the corresponding folder name, for the first stage animation picture directory;
P 0 0 Part1---Here the p represents the marker, 0 represents the infinite loop of this stage, 0 represents the phase interval of 0,part1 representing the corresponding folder name, and the second stage animated picture directory;

Phase Switch interval: unit is the duration of a frame, such as the number of frames is 30, then the duration of the frame is 1 seconds/30 = 33.3 milliseconds. Phase switching interval time during the boot animation process into hibernation, the CPU time to initialize the system to use. That is, the long interval starts quickly, but it affects the animation effect.
The Part0 and Part1 folders contain a series of two animated images, in PNG format. The load refresh of the series picture files is sorted by the name of the file name. It is important to note that after the property description is complete, a newline character (carriage return jumps to the next line) has been made to ensure that the instructions are complete.
(3) After the pictures and desc.txt documents are ready, start packing as Bootanimation.zip. Select the Pictures folder Part0 and Desc.txt (to remind you: before packaging the picture folder Thumbs.db Delete), and then right-select WinRAR "Add to Compressed file" to enter the custom compressed file settings: Compressed file format selection: Zip, compression mode selection: storage, then click OK.

Note:/system/media is under/out/target/product/tbdg1073/system/media/

==================================================================================================

Ouyangpeng welcome reprint, sharing with people is the source of progress!

Reprint please keep the original address: Http://blog.csdn.net/ouyang_peng

==================================================================================================

Android system porting and debugging-------> How to modify the boot animation two ways to dissect "go"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.