The boot animation is created by a set of zipped images and a small script. Full instructions are here – http://forum.xda-developers.com/showthread.php?t=1852621 – these are the instructions that I followed so I know that they work.
Now, you will face a few problems trying to do this with an app. Firstly, the default location that the OS will look for the boot animation is /system/media, but this is not the same on all versions of android, and some phone manufactures change it a different place. So to resolve this you will have to compile a list of as many possible locations and have your app check all of them for an existing animation and then replace the one that it finds.
The second problem is that all of the locations will require root privileges to copy a file into. Adding this into the manifest will allow your app to do this on rooted phones.
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
2
solved How to change Cell phone company logo in android [closed]