Set Android boot animation, boot logo

Source: Internet
Author: User
Tags imagemagick

we want to change is the System>media directory of bootanimation.zip (mobile phone boot animation) This file
first of all, this file structure: The zip decompression to get two files,
The first folder holds the picture that is played when the boot is turned on (pictured is the best domain G3 original animated picture package), see:

image number 001,002, ..... 010 These are used to control the order in which the pictures are played
. A second desc. TXT text documents hold the data and text to control the speed (frame rate) and playback of the picture, see:
The meaning of these text data is explained below: 720 indicates that the picture is like wide 720 pixels.
1280 indicates that the picture is 1280 pixels high.
10 means the pictures are played at 10 frames per second
P is the first letter of play, which means playing
The first 0 indicates that the animation loops until it is turned on (if 1 means it is played only once)
The second 0 indicates that a group of pictures is finished to the next set of pictures with a delay of 0 seconds (no tube here, because a group of pictures is usually
All right, we'll talk later.)
Folder1 is the name of the folder where the picture is stored.

In Short, popular speaking, is the boot logo display after the system to 10 per second of the speed of the Folder1 folder to play the picture, the image size of 720*1280, and constantly cycle this set of pictures until the boot.

Finished the structure, you can come to the start! (It is highly recommended that you directly name the group of pictures you want to use, 001,002, 003, 004 ...). format as PNG or JPG, size must be 720* 1280, copy the picture directly into the Bootanimation.zip Folder1 folder, and delete the original 10 pictures, control text desc. TXT directly modify the line, do not create their own! Avoid the need to bring trouble! Because Android is based on a Linux system, the desc.txt that are written directly cannot control the image playback, unlike the code under Windows.




Android Boot In fact there will be a total of 3 images:

1, the first is the Linux system boot, the appearance of the Linux penguin Picture (reboot);

2, when the Android system boot from the Linux kernel, will perform the Anddroid platform initialization process, the screen will appear "A N D R I O D" text screen (but in my system this interface does not appear, or the naked eye does not see the appearance of this screen, This picture is still sent here to modify the method);

3, boot animation: This stage is everyone can see the system during the startup process, display the "a n d r o i d" after the words displayed pictures, similar to the progress bar, the picture content is "a n d r o i d" words.

The first (Little Penguin) screen modification:

After booting the Linux kernel boot, load the picture and the code involved is in the following directory:
/kernel/trunk/drivers/video/fbmem.c
/kernel/trunk/drivers/video/fbmem.h
/kernel/trunk/drivers/video/logo/logo.c
/kernel/trunk/drivers/video/logo/logo.h
/kernel/trunk/drivers/video/logo/kconfig
/kernel/trunk/include/linux/linux_logo.h

The steps for adding this boot logo to the kernel are as follows:

1. Let the kernel support the boot logo


Make menuconfig in the kernel directory

Device Drivers----> Graphics support---->

Select Bootup logo----> Standard 224-color Linux logo

2, the production of the image of the boot logo

The image that will be used as the boot logo is cut according to the size of your screen and saved in BMP format or PNG format; such as Linuxlogo.bmp or linuxlogo.png

Under Linux, enter the following command (for BMP):

#bmptoppm linuxlogo.bmp > linuxlogo.ppm//Generate PPM
#ppmquant 224 linuxlogo.ppm > linuxlogo224.ppm//Convert to 224 colors
#pnmnoraw linuxlogo224.ppm > linuxlogo224.ppm//Convert to ASCII format

Under Linux, enter the following command (for PNG):

# PNGTOPNM Linuxlogo.png > LINUXLOGO.PNM
# pnmquant 224 LINUXLOGO.PNM > LINUXLOGO224.PNM
# PNMTOPLAINPNM LINUXLOGO224.PNM > linuxlogo224.ppm

Note: The above command requires the installation of the NETPBM Toolkit sudo apt-get install NETPBM

3. Put the logo file into the kernel


Copy to the created logo file to the/drivers/video/logo folder.

Replace the logo_linux_clut224.ppm file, and also delete the LOGO_LINUX_CLUT224.O and logo_linux_clut224.c under the folder

4, re-compile the kernel is OK! This is not an unknown word.

The second ("A N D R I O d" text screen) screen modification:

Related code:

/system/core/init/init.c
/system/core/init/init.h
/system/core/init/init.rc
/system/core/init/logo.c

Steps to make the *.rle file:

1). Make a picture of the current screen pixel

Use PS to make a picture suitable for screen size, save as "Save as Web format", then on the popup window, "preset" Item select "PNG-24", Save As Android_logo.png (

Note: It seems that only support png-24, other formats generated RLE file display is not normal, interested people can be verified again.

2). Convert the picture to RAW format
Using the Convert command from the ImageMagick in Linux, the RAW format is converted with the following command:
Convert-depth 8 Android_logo.png Rgb:android_logo.raw

Note: Ubuntu 10.04 has the Imgagemagick tool installed by default, and if the current system is not installed, you can perform the following command installation:
sudo apt-get install ImageMagick

3). Convert raw format to RLE file
Need to use the Android compiled rgb2565 tool, in the Android/out/host/linux-x86/bin directory (Android is the current source directory), the conversion command is as follows:
Rgb2565-rle < Android_logo.raw > Initlogo.rle

So far, the boot needs to display the image has been done, that is Initlogo.rle, note that the file name must be this, if you want to change the file name, you need to modify

Macros in Android/system/core/init/init.h:
#define Init_image_file "/initlogo.rle"

4). Copy the prepared Initlogo.rle files to the root directory of the Android system, which is out/target/product/..../root

Finally compiled into a file system image xxx.img re-burn. Ok.

Third (boot animation) screen

In fact, this part of the animation is the use of two images displayed, the specific picture file path is: frameworks/base/core/res/assets/images, we look at the know, also know how to modify.

And this part of the relevant source files are mainly the following: Frameworks/base/cmds/bootanimation the following several files are, you can look at the contents of the BootAnimation.cpp file, there are the following code snippet:

BOOL Bootanimation::android ()
{
Inittexture (&mandroid[0], massets, "images/android-logo-mask.png");
Inittexture (&mandroid[1], massets, "images/android-logo-shine.png");
BOOL Bootanimation::android ()
{
Inittexture (&mandroid[0], massets, "images/android-logo-mask.png");
Inittexture (&mandroid[1], massets, "images/android-logo-shine.png"); This is where the foreground and background images are set to appear.

   then look at the following code:

[cpp] #define USER_ Bootanimation_file "/data/local/bootanimation.zip" &NBSP;
#define System_bootanimation_file "/system/media/ Bootanimation.zip "&NBSP;&NBSP;
#define System_encrypted_bootanimation_file"/system/media/ Bootanimation-encrypted.zip "&NBSP;
#define User_bootanimation_file"/data/local/bootanimation.zip "
#define System_bootanimation_file "/system/media/bootanimation.zip"
#define SYSTEM_ENCRYPTED_BOOTANIMATION_FILE "/ System/media/bootanimation-encrypted.zip "          look at the macro name I believe you will know, This is the name of the set animation file. Why does it show the picture again and animate it, this Android version is related. Showing two images: foreground and background images are used in the 1.5 version, then changed to set the animation file, that is: Bootanimation.zip, is the zip format, this file contains three content: two directories: Part0 and Part1, a file desc.txt.
Two directories are used to contain the pictures to be displayed, divided into the first and second phases. The rest of the file is about setting up information about how to display:
Examples are:
480
    P 1 0 part0
    P 0 0 part1

The specific meanings are as follows:
480--width of the image, 800--height of the image, 15--frames of second
P 1, display one time
P 0, display recycling till handset power on finished, I believe you understand! Oh.

You can make your own bootanimation.zip files placed in the appropriate directory, this can replace the default boot interface: Here the right directory is the above macro definition, we all know ^_^!
How to make Bootanimation.zip file? Create two directories and a file as above, then use the software or a command-line package to
Zip-r-0 bootanimation.zip part0 part1 desc.txt


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.