Replacing the boot animation for Android phones

Source: Internet
Author: User

I always wanted to customize my G6 boot animation. After a while, I finally won it.
According to the tutorial on the Internet, the Linux user must have a good trip and it will be done soon; but if it is a window user, it will be unlucky-I belong to this unlucky part.
Reference post:
Http://www.droidforums.net/forum/droid-hacks/9163-desc-txt-boot-animations-works-like.html

Here is the Code address for implementing the system boot Animation:
Http://android.git.kernel.org /? P = platform/frameworks/base. Git; A = blob; F = cmds/bootanimation. cpp; H = 12c9fe502220fb489b01_b0e895d5d8c37d29cf; HB = head

Go directly to the step
1. Prepare the image material. The format is only PNG, and name the image file according to the playing sequence.
The code is 401 to 413 lines.

2.compile desc.txt. The desc.txt file describes the number of frames and image sources of the boot animation.
Open desc.txt in windows and there will be only one line, for example, "320 480 30 ■ P 1 0 part0 ■ P 0 10 Part1 ■"
If you select all and copy it to another text editor, you will see that the Code will be reformatted:
320 480 30
P 1 0 part0
P 0 10 Part1

Now, we have two questions:
2.1 What does "■" mean when I open it directly? Why does the ROM author let the users in the window see "■?
What does code 2.2 mean?
A:
2.1 "■" indicates that the file is a "line feed" generated in Linux. However, since each line in a window ends with a line break and a carriage return, only a black box is read.
Because androidis the linuxsystem, when desc.txt is written into the mobile phone, the window must delete the "enter" character. Otherwise, Android will make up a string of "enter" and "P" in the next line, resulting in invalid information, A black screen is displayed when the mobile phone starts. Delete the hex editor NEO used by the tool. Alternatively, you can just press the code and press Ctrl + C/Ctrl + V to change the line.
2.2 code explanation:
"320 480 30" → "The picture displayed at startup is wide and the picture is high and the number of frames displayed at startup"
320 480 is not the pixel width or height of the screen or image. In the experiment, any value can be written. When the system is started, the image is automatically deformed to a specified value of width and height.
The following several lines define several boot animations.
"P 1 0 part0" → "animation phase identifier Number of animation loop playback times the animation phase ends with a delay duration name of the animation phase folder name"
When the number of animation loop playback times is "0", it indicates an infinite loop until the boot is complete.
Related code: 345 → 418 movie () method.

After compiling the desc.txt file, we need to package the existing resource file into the bootanimation.zip file. For the reason that the file name is always bootanimation.zip, see the definition of the constant system_bootanimation_file in the code. Zip is a common Linux compressed package format.
You can use WinRAR for packaging. Select the "Zip" compression format, and select "Storage" for the compression method ". For example:

Okay. Bootanimation.zip is ready. Use the tool to replace bootanimation.zip under/system/mediaon on your mobile phone. After you restart your mobile phone, you will find that the boot animation has been shown as your prepared materials.

Supplement to 2.1:
Before the computer appeared, there was a kind of device called teletype model 33, which can contain 10 characters per second. But there is a problem, that is, when a line breaks a line, it takes 0.2 seconds, just two characters. If a new character is passed in the 0.2 s, the character will be lost.
As a result, the developers thought of a way to solve this problem, that is, adding two end characters after each line. One is "enter", which tells the typewriter to position the print head on the left boundary, and the other is "line feed", which tells the typewriter to move the paper down one line.
This is the source of "line feed" and "Carriage Return". They can also be seen in their English names.
Later, computers were invented, and these two concepts were invented on computers. At that time, memory was very expensive. Some scientists thought it would be too waste to add two characters at the end of each line. Just add one character. As a result, there were differences. In Unix systems, each line ends with "<line feed>", that is, "/N". In Windows systems, each line ends with "<line feed> <press enter> ", that is, "/n/R". In MAC systems, the end of each line is "<press enter> ". One direct consequence is that if a file in UNIX/MAC is opened in windows, all the text will be changed to a line; if a file in Windows is opened in UNIX/MAC, A ^ m symbol may be added at the end of each line.

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.