Android is a lot of fun for people who like to tinker with things, especially for rooted users. Even without root, the platform allows third party apps to dig deeply into the OS’s inner workings, changing defaults and adding menu items. If you’ve ever used Dolphin Browser or Share by QR Code, you know this. One lesser known fact is that you can actually replace the animated boot screen on your Android 2.1 device fairly easily, and even create your own.

First, you’ll need the Android SDK installed on your computer. Installation is fairly involved, so I’m not going to cover it. There are also other benefits to having this (taking screenshots, providing developers with debug data, etc), but what we’re after is a utility called adb. adb stands for Android Debug Bridge and is a fairly simple tool that allows you to communicate with your phone via your computer. Follow the steps here to install the SDK, which includes adb:

http://developer.android.com/sdk/index.html

Make sure you follow the instructions, or you’ll just wind up frustrating yourself.

Note: You may or may not be able to accomplish this process using a file manager from the Market, just by copying the animation zip to your sd card, then moving it to /data/local/ using the file manager on your phone.  You do not need root to write to /data/local/.  My file manager does not allow me to copy or move files but others may.  Still, using adb is much easier in the long run, even if it is kind of a pain to set up. If you have a file manager that will let you do this, you do not need adb.

Next, you need a boot animation to use. You can make one, which I’ll cover later, but now that you spent all of that time installing the SDK, I’m sure you want to test this out with minimal fuss. You can find some here:

http://androidforums.com/htc-droid-eris/56647-boot-animation-gallery.html

along with a wealth of information about this topic. Go ahead and find and download one that you like.

Important: If you are on a Mac or in some other situation where zip files that you download are automatically decompressed, you need to either circumvent this decompression (opt+click on a Mac) or rezip the file using the instructions below in the section about making your own animations.

Now that you have your boot animation, we need to get ready to push it to the phone. First, verify that the file you’ve downloaded is named “bootanimation.zip”. If it is not, change it.

Second, enable USB debugging on your phone. Open Settings, select Applications, then select Development. You’ll see an option for USB debugging. Enable it. Go ahead and connect the phone to your computer via USB if you haven’t already.

Next, we get to actually install it. Open up your terminal or command prompt (Mac users: use Spotlight to find Terminal. Windows users: Press Alt+F2 , type “cmd” and hit enter. Linux users: …you know this, right?) and do the following:

  1. use cd to get to where you saved bootanimation.zip
  2. type: adb push bootanimation.zip /data/local/
  3. type: adb reboot

If all goes well, your phone should reboot and when it does, after the boot image appears, you should see the animation.

If you would like to remove the boot animation and roll back to the default, go back to your terminal and type:

  1. adb shell
  2. rm /data/local/bootanimation.zip
  3. exit

Creating Your Own Animations

Think you’re ready to make your own animation?  The generally accepted format for boot animations is a series of PNG files, scripted with a simple text file. From here on out, I’ll assume you’ve already created the animation in some application and that you are comfortable exporting your animation in PNG format. If not, Google is your friend. You’ll probably want to read this whole section before giving it a go, as file locations matter and so on.

The files can be in any PNG format, as far as I am aware, but the smart thing to do is to export or convert them to 8 bit PNGs with the smallest possible color palette. By smallest possible, I mean the smallest possible one that meets your own quality requirements. You ideally want each PNG file to be between 4 and 32 kb. It’s ok if they’re a little larger, but smaller files result in smoother animations.

The folder structure you need to use is like so:

bootanimation folder structure

Next, you need to write the script that tells your phone how to use the PNGs you’ve created. The script is in a very simple format. It will be named desc.txt and saved in the folder containing the folders that contain your PNGS. Open up a text editor.

On the first line, you define the width, height, and frame rate like so:

320 480 30

Android will do a pretty decent job of making the animation fit the screen if it is used on a screen with a different size than yours. I haven’t played around much with the frame rate yet. 30 is pretty fast, but the animation is very smooth. The standard frame rate in video animation is 24 fps. In video games, it is 60.

Next, you’ll have a line like this:

p 1 0 part0

p is just a delimiter and essentially means nothing. All lines after the first line will start with a p. The 1 tells Android to play the sequence of PNGs 1 time, and then the 0 says to pause for 0 frames. This would be a good line to start with if your animation fades in from black or is otherwise not a simple loop.

If you had a part that you wanted to loop, you could enter something like:

p 0 0 part1

for that. the first 0 tells it to loop infinitely.

You can have as many p lines as you like, but each needs its own folder. The desc.txt file for the Nexus One’s boot animation looks like this:

512 256 30
p 1 0 part0
p 0 0 part1

Again, this plays all of the files in part0 once, then plays all of the files in part1 over and over until the OS comes up.

The file names in each of these folders, to my knowledge, need to follow this format: boot_#####.png. This may not actually be necessary, but it’s how I learned to do it. Following this pattern, the first file in the animation would be boot_00001.png. The last might be boot_00095.png. If the last frame in part0 is boot_00024, the first in boot1 should be boot_00025. This may not really matter…feel free to experiment.

Finally, we are ready to zip this up. Make sure that there are no files like Thumbs.db or .DS_Store inside the folders that contain any of the animation files. These will cause an obnoxious white flicker. When you zip your files you absolutely cannot use the built-in compression available via right click in any OS that I know of or your zip will not work. You have to be able to set the zip so that it is not compressed, just rolled into a zip file. I do not know how to do this on Windows, but I do know that it is possible using WinZip. If you are lucky enough to be on OS X or Linux, you can simply issue this command in Terminal from the folder containing the folders named part0, part1, etc:

zip -0r bootanimation.zip .

After that, you’re ready to push it to your phone using the method from the beginning of the post.  Happy animating!