Set Android boot animation, boot logo

Source: Internet
Author: User
Tags imagemagick

we want to modify the System>media folder under the Bootanimation.zip (mobile phone boot animation) This file
first of all, this file structure: The zip decompression to get two files,
The first directory holds the picture that is played when the boot is turned on (pictured is the G3 of a good domain), 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 following explains the meaning of these literal data: 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 means that the animation loops until the boot is turned on (assuming 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 general set of pictures
All right, we'll talk later.)
Folder1 is the name of the directory 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 directory to play the picture, the image size of 720*1280, and constantly cycle this group of pictures until the boot.

Finished the structure, 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, the picture is copied directly into the Bootanimation.zip Folder1 directory, and delete the original 10 pictures, control text desc. TXT direct changes can, do not create their own! Avoid the need to bring trouble! Because Android is based on Linux, the desc.txt is not controlled by the code that is written directly in 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 run 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, Here still send this screen change 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 changes:

After booting the Linux kernel boot, load the image with the code in the following folder, for example:
/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

Let the kernel join this boot logo process such as the following:

1. Let the kernel support the boot logo


Make menuconfig in the kernel folder

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

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

2, the production of the image of the boot logo

will be as the boot logo image according to your screen size to cut, and save it as BMP format or PNG format; Like 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/drivers/video/logo directory to create a good logo file

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

4, once again compile the kernel is OK! This is not an unknown word.

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

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 for Web format", and then on the pop-up form, "preset" Item select "PNG-24", Save As Android_logo.png (

Note: As if 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, assuming that the current system is not installed and capable of running the following command installation:
sudo apt-get install ImageMagick

3). Convert raw format to RLE file
Need to use the Android compiled rgb2565 tool, under the Android/out/host/linux-x86/bin folder (Android for the current source folder), conversion commands such as the following:
Rgb2565-rle < Android_logo.raw > Initlogo.rle

Up to now, the launch need to display the image has been done, is Initlogo.rle, note that the file name must be this, false idea change the file name, need to change

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

4). Copy the prepared Initlogo.rle files to the root folder of the Android system, that is, under Out/target/product/..../root

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

Third (boot animation) screen

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

And this part of the relevant source code files are mainly for example: Frameworks/base/cmds/bootanimation The following several files are, can look at the contents of the BootAnimation.cpp file, such as 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, for example:

[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 is the picture displayed again and animated display, this Android version number 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 folders: Part0 and Part1, a file desc.txt.
Two folders are used to include the pictures to be displayed, divided into the first and second phases. The rest of the file is to set information about how to display:
scale as follows:
480
    P 1 0 part0
    P 0 0 part1

The detailed 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 folder, this can replace the default boot interface: This is said to the appropriate folder is the above macro definition, we all know ^_^!
How to make Bootanimation.zip file? Create two folders and a file as above, and then use the software or a command-line package to
Zip-r-0 bootanimation.zip part0 part1 desc.txt


Set Android boot animation, boot logo

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.