I'm working on some boot animations but running into a wall trying to add sound. Maybe I'm just overlooking something. Was wondering if anybody else might be trying this.
I tried pushing a bootanimation.bin that had sound enabled to /system/bin but got nothing but black screen.
I don't know if it's even possible. Any suggestions?
I was reading through the MIUI thread at:
http://forum.xda-developers.com/showthread.php?t=1424434
and on post #43 I saw:
http://www.youtube.com/watch?v=OqiX-If5w_4
which near the end (about 3:07 in) showed the bootanimation with sound.
I would think if you downloaded the rom and pulled out its bootanimation files you might get a hint about the syntax needed for the desc.txt file to play sounds.
I played with this idea on my phone (Moto Photon) and was able to play multiple sound files at specific points in the animation sequence.
----------------------------------------------------------------------------
EDIT: I got curious regarding this issue, so I downloaded MIUI, CM7, and stock .bin to see what I could discover...near as I can tell, MIUI is only one to include a sound file for bootanimation (if the others do, it is cleverly hidden somewhere other than /system/media/ or /system/media/audio/notifications/) and probably requires some system specific support for the call to play the sound file.
As I mentioned above regarding my phone, the sound file had to be in /audio/notifications/ but also had to have a line in the desc.txt file to call it that looked like this:
480 800 15
p 1 0 part0
s bootsound.mp3
with the last line indicating the specific sound file in notifications to play.
Bottom Line - Unless you are on MIUI I have little to add to help. (took me long enough to say that, didn't it?)
Thanks. Yeah I notice the same regarding all but the MIUI rom. Tried moving some files around for sound on cm7 now I got sound but no animation lol.
where did you put the sound file in CM...and did you have to reference it in the desc.txt?
Actually I took the bootanimation.bin from the miui build in /system/bin and moved it to the same dir on cm7. Since that calls the animation and sounds. I noticed in that bin file that it calls an audio file named bootaudio.mp3 from /system/media and it isn't listed in desc.txt.
So I just put the bootaudio.mp3 and bootanimation.zip from miui in /system/media with no reference to sound in desc.txt and it plays the sounds but no animation.
Maybe unpack the entire contents of the bootanimation.zip, check the desc.txt file with notepad++ to make sure there is a hard return at end of file and then repack everything with 7-zip with no compression (store mode I think). Maybe MIUI allows for compression in the bootanimation.zip file and CM doesn't. Also, you might try to get animation working without sound and then add that back in (although having the sound in there at least lets you know the boot is progressing...)
sorry for the slow reply...been out of town for a few days...if you have already solved this issue, I'd be curious to hear how.
So I now got sound and animation on CM7 thanks to NUNsLAUGHTER92 over at android forums.
Had to edit build.prop added line:
ro.config.play.bootsound=1
Also edited init.local.rc (located at /system/etc) added lines:
service bootsound /system/bin/bootsound
user media
group audio
disabled
oneshot
on property:init.svc.bootanim=running
start bootsound
on property:dev.bootcomplete=1
stop bootsound
Then downloaded this file called bootsound.txt and renamed it bootsound without .txt extention and place it in /system/bin.
Sound file goes in /data/local named android_audio.mp3. Audio is a little on the loud side but hey it works.
Thats a lot just for boot sound lol.
I've been messing around with boot but am not that creative and this device boots pretty fast so... small window. lol. I threw together this boot animation from "The Walking Dead" (love that show). Put bootanimation.zip in /system/media. Extract and put android_audio.mp3 in /data/local. Should have sound (on cm7) if followed the post above. Not the greatest by a long shot but its different.
Related
So guys, I think together we can solve this mysterious bootup thing.
I found out that a custom bootupsound only plays with the original bootanimation.zip.
This is what I posted in the MoDaCo-Forums (running on MoDaCo-Rom. )
What we need is all here:
/system/customize/resource/
-> bootanimation.zip
-> android_audio.zip
Now I found out, only the HTC Bootupanimation works. I dunno how to build these ZIPs, I worked with HxD and found nothing in the ZIP-Header.
I think it is something with the desc.txt and the filenames of the PNGs.
This mean that:
desc.txt:
480 800 15
p 1 1 android
Filename:
wvga_htc_bootup_android_104f_15fps_005spf 01.png
wvga -> Screenresolution
htc -> yeah, you know.
bootup -> maybe its' there because it's in the bootupanimation? ;D
android -> folder, bootupanimation.zip has only the folder android -> look in the desc.txt above
104f -> Maybe Frames? I have only 78 Frames in the HTC-Bootup
15fps -> desc.txt -> the Frames per Seconds
005spf -> Dunno. SoundPerFile?
01 -> Frame. ...
Now I need help. I know: Other Bootanimations doesn't play sounds.
No Animations play sounds.
HTC Animation play a sound too.
Anyone build Bootanimations? Any Help? Maybe we can f*ck this file, and build awesome animations with SUPER GREAT SOUNDS.
€: After pushing the original cyanogenmod-Bootanimation-PNGs with new Name (them from the HTC-Bootanimation) it does nothing. Only a black screen.
With the desc.txt from HTC-Bootanimation pushing in the CY-Bootanimation plays, but comes with no sound.
It's a mysterious for me why the hell the HTC-Bootanimation plays this fkkn' Sound, and other Bootanimations not. God dammnit.
*bump*
Noone who ask the same?
I hope we work together on this.
Don't work to hard. The majority of users will (given the choice), opt for a silent boot.
Yeah, but why the we don't use the function to boot with Great / Funny / Awesome sounds?
Maybe a jumping Mario with synced sound? Or GLaDOS and a great animation?
That would be great, I think.
But ATM i'm stucked with this animation, mayber there is anywhere a secret value ... but I can't find it, what is different from the other bootanimanimations.
I'm going to put a link to this here, because it's relevant to the Mesmerize, but resides in the Fascinate forum. IMO, the Voodoo 5 kernel is awesome and should warrant some attention in the Mesmerize forums.
http://forum.xda-developers.com/showthread.php?t=871915
Nice! Finally got our spot on the forum.....this should help a ton! We should compile a list of all threads that belong here, i know it has been confusing to keep everything straight up till now.
Custom boot animation to go with kernels
I posted this in response to some questions in the other forum so I thought I would paste it here also.
OK, back at the house so here's a quickie on custom boot animation that you can add while using these kernels. I'll post a link so you can check one out.
First, you will will notice it's just a zip file named bootanimation.zip. It is a zip file that is NOT compressed. So when you zip your files up, remember to select store for compression level. This tripped me up for an hour when I first tried this out.
Inside is two folders labled part0 and part1, and a text file named desc.txt. Part0 is the first part of the boot animation that is run one time. Part1 is the part of the animation that can loop over and over depending on how long it needs to and how long it is told to. These two parts need to flow together to look good, so be mindful of this. Also, you don't want to make your boot animations too long. They take up space that can be very valuable on phones that have little to begin with. Ours don't have a problem, but some do.
Inside the folders is a series of PNG files. They are named and numbered. Keep it simple. These are boot_000003.png on up to the end. Make sure you have the zeros in front to keep the spaces, otherwise they could get played out of order. Keep you png files the same specs as your phone. Ours is 480 x 800 pixels. Make sure you work in pixels not inches or cm.
The desc.txt file can be a little confusing at first also. It's just numbers and letters. This particular one looks like this:
480 800 30
p 4 0 part0
p 0 0 part1
That just tells the phone it's looking at pictures that are 480x800 pixels and it's going to go thru them at 30 frames per second (15 is commonly used also). I'm not sure what most of the rest is for other than part0 and part1, obviously, but the second 0 is for looping. 0 tells it that part1 can loop infinitely if need be. So it will continue to play as many times as it needs, until the phone finishes booting.
This particular boot animation was a quickie that I downloaded from UOT Kitchen by going through the process of not selecting anything except the boot animation, finishing the build as a cyanogen based ROM, and the downloading the package. Once it was done, I just modified the png's and the txt file and it was ready. Stored it in a zip file and I put it on my sdcard. From there you can just move it to /system/media. I just use root explorer to do this, but others may want to push the files. Do it however you are comfortable. Once there, all you do is reboot and as long as your kernel is compatible, these are, then it will play the bootanimation.
This is the nexus one's colorful x. Nothing fancy, just a quick one to show you how it's done.
http://dl.dropbox.com/u/14910866/bootanimation.zip
This thread is about on how to make your own bootanimation for your I9003 Gingerbread.
BASIC
Inside the sanim.zip file
If you extract the contents of the sanim.zip file to your computer, you will see:
- A desc.txt file
- A part0 folder (Contains PNG images named in incremental numbers)
More part1, part2 etc. folders (May or may not be present)
As you can see, sanim.zip merely contains one text file and one or more folders with PNG images. The animation is played simply by displaying the images in a sequence, and the text file defines how they are to be played. In essence, first the PNG files in the part0 folder are displayed one after the other and afterwards, those in the part1 file – if it exists – are displayed, again one after the other, and so on.
The folders
These contain PNG images named in numbers, starting from something like 0000.png or 00001.png and proceeding with increments of 1. There has to be at least one folder, and there is no known upper limit to the number of folders.
The desc.txt file
This file defines how the images in the folder(s) are displayed during the boot animation, in the following format:
Width Height Frame-rate
p Loop Pause Folder1
p Loop Pause Folder2
An example of a desc.txt file is:
480 800 30
p 1 0 part0
p 0 0 part1
As you can see, in the first line, 480 and 800 define the width and height of the boot animation in pixels for this example. This must be the same as the screen resolution of your device for the boot animation to properly play in full screen. 30 is the frame rate in fps (frames per second) i.e. number of images to display per second. (resolution for I9003 is 480x800)
The second and third lines have a same format, start with p, which stands for a part of the animation and end in part0 or part1, which denotes the folder in which the images for that part are present.
The number after ‘p’ defines how many times this part will loop (repeat playback) before switching to the next part (if present). Specifying 0 would make the part loop indefinitely till the phone has fully booted.
The next number is for the pause, and is expressed in the number of frames, which can be translated into time by dividing it by the frame rate. A pause of 15 for example, would mean pausing for the time it takes 15 frames to play and since the frame rate is 30 frames per second, 15 frames would take half a second.
Translating all of this in case of the above example, the boot animation will play at a resolution of 480 by 800 pixels, at a frame rate of 30 fps, starting with the contents of part0 folder and after playing them in one loop, switching to contents of part1 folder and playing them continuously till the device fully boots.
Note: Most high-end Android devices with large screens have a resolution of 480 x 800 pixels, and are referred to as HDPI. Some mid-range devices have a resolution of 320 x 480 pixels and are called MDPI. Lastly, the screen resolution of some low-end devices is 340 x 320 pixels and these are called LDPI.
Requirements:
1. A zip/unzip utility like 7-Zip
2. Image editor of your choice like Photoshop, GIMP, Paint.NET, and also MS Paint.
3. A plain text editor of your choice. Using Windows Notepad for editing text files that are to be used in Linux is not always a good idea, so use something like Notepad++ instead.
4. Creativity and Time
5. I9003 screen resolution is 480x800
Procedure:
1. Go through the entire inside the sanim.zip (Description on the top post, if you haven’t already done so)
2. Plan how your boot animation will run including how many distinct parts it will have, how long will each part play and what will be the sequence of the parts.
3. Make a new folder at any convenient location on your computer, and name it sanim.
4. In this folder, create a folder for each part of your boot animation, named part0, part1 and so on.
5. In the image editor of your choice, make all the image files for each part of your boot animation with the proper which is 480x800 equal to I9003 phone screen resolution, and save them in the respective folder for each part, in PNG format. Up to 32 bit PNGs are supported.
Note: In case you are converting an existing boot animation to fit your phone’s screen, simply extract the images from it and resize each of them to your device’s screen resolution.
6. Make sure the images are named in numerical format and in proper sequence, i.e. the images in the first part should start with let’s say 000.png and go on till 075.png, and the images in the second part should then start off with 076.png and go on till – for instance – 123.png.
7. Once you have the images for all the parts done and saved with proper names in each folder, create a text file named desc.txt in the main sanim folder.
8. Open the text file in a text editor and edit it in the format described in detail in the desc.txt file section above. Do consider that a frame rate higher than 30 fps can give issues on many devices.
Note: In case you are converting an existing boot animation to fit your phone’s screen, keep everything the same as in the original desc.txt file and change only the resolution.
9. Now select everything inside the sanim folder and zip them into a new uncompressed zip archive using your favorite compression utility. Here is the method using 7-zip:
9A. Select everything inside the sanim folder.
9B. Right-click on any of the selected files/folders and from the 7-zip menu, select ‘Add to archive’.
9C. Use ‘zip’ as the archive format and ‘store’ as the compression level, and click OK. This will create a file called sanim.zip in the same folder.
DONE with your own bootanimation.
Applying sanim.zip into I9003
Copying the sanim.zip to /system/media/. Make sure you have root access and mount your system to R/W access. This will be done by Root Explorer. After that reboot your I9003
Note: Make sure you have done backup your original sanim.zip to somewhere safe like External Card or PC. This can be done by MOVE the file out from the original place and paste it to your External Card.
The Droids series by Dysgenic
Download (XDA Developer)
Android Particle Ring by Dysgenic (Modified by aph):
Download (XDA Developer)
This article has been modified to fit with I9003 Bootanimation
Original post from www.addictivetips.com
UPDATED (21/10/2011)
Creating a boot animation, start to finish.
The following is a start to finish how to via the method that I create boot animations. I can't take full credit, as I have found bits and pieces here an there. I just put them all together..in one place. This isn't an easy process, and does require quite a bit of time.
Tools you will need
- DVD Videosoft Studio
- Gimp or Paint.net or fotosizer
- Zip file creator like 7zip
So get all the programs dloaded and installed and figure out what you want to use for your animation.
You can use images or a clip of video.
We will begin with a youtube video. Youdoofus has supplied us with an excellent specimen.
YouTube - Doin' Your Mom - with dancing cat
A. Downloading a video (Skip these steps if using some other video. Go to B.)
Open the video studio
Click Youtube
Then Youtube download
Paste the link of the video you want to use
Click download (bottom right)
Close out of the Download screen, un check all of the boxes in the pop-up otherwise the program does install web toolbars.
B. Extracting Images from any video. (Skip to C if you already have images.)
Open the video studio
Click on Photo and Images
Free Video to Jpeg
Browse to you video file
Select the option (I use every frame so I can pic and choose)
Close studio, remember to un check the boxes
C. Convert Images
Create a folder on your desktop and put your images in it.
Use you photo edit tool of choice. I use fotosizer, it allows batch.
Select your size. For the Evo use 480x800
Choose Destination Folder I always create a new folder
Output as .png
Filename mask should be %f (the other options never work for me)
Choose add images
Highlight all of the images
Click Start
Now open the new folder of converted images (you can delete the originals folder from the first step above)
Right click on the first image and select rename
Rename in numerical order 0001 pressing tab after you are done..until you reach the end. I don't use more than 100 images. Small groups like this can be repeated. I only pulled 15 images from the video. We will have it loop in the script below.
D. Building the bootanimaton.zip
Create two folders, named part0 and part1
part0 will contain a single, display once png and part1 would contain the animation images. You can play with different scenarios here...ie loop images until boot is complete or loop once and stop on one last image. I will get more details together soon.
Place animation files in part1 folder and a "frozen image" in part0 if you choose to set it up that way.
We need to tell the animation what to do with this type of txt file
480 800 60
p 0 0 part0
p 0 0 part1
again
The boot animation is stored on your phone as a zip file in the folder /system/media. It consists of 2 folders part0 and part1 and a description text file (desc.txt). Both part0 and part1 folders contain animation frames as PNG files. part0 folder contains those frames which are animated only once, where as part1 folder contains the looped(repeated) frames. The desc.txt file contains the animation settings such as fps (number of frames per second), width, height, times to be played, pause time etc you can change up a lot here.
Ctrl+ select the part0 file the part1 and the desc text file and right click.
Select 7zip or your zip program and then "add to blahblahblah.zip" Make sure to do .zip and not the other choices. Make sure your default settings are for no compression.
Rename the file bootanimation.zip (remember not to name it .zip.zip) I keep a few animations on my sd car in a file called "booty" so I typically put something in front like kitty_bootanimation.zip so i know which is which.
Put the file on your sd card.
Use root explorer to navigate to system.media and rename the current boot animation to whatever you want.
Now copy your new animation from the sd card to system.media
In some cases the animation will be located at system.customize.resource
To add an audio clip use any mp3, renamed android_audio.mp3 and put it in the same place as your animation. Keep in mind audio doesn't work on all roms. You may also need to adjust the length. I use Audacity for that on the pc, and there are a number of ringtone trimmers that will do it on the phone.
ALSO SEE THIS:-
1. How to make your own boot animations (with sound if you want) by despotovski01
2. How to preview your Android boot animations on your computer by despotovski01
3. Boot Animation Creator-Make Android Boot Animations With Ease! by despotovski01
superb bro.
wow.. thanks for sharing man...
doesnt work for me : forum.xda-developers.com/showthread.php?p=18607910#post18607910
Nice Explanation bro..You might check my attched file and Maybe It will fit on your thread...\m/
blaqkarma said:
Nice Explanation bro..You might check my attched file and Maybe It will fit on your thread...\m/
Click to expand...
Click to collapse
OP UPDATED! thanks...
Thanks im a complete beginner at this but gonna give it a go i will share when completed
Sent from galaxy s2 , somewhere having a beer using xda premium
adz63 said:
Thanks im a complete beginner at this but gonna give it a go i will share when completed
Sent from galaxy s2 , somewhere having a beer using xda premium
Click to expand...
Click to collapse
u shud share
Droid Bionic Boot Animation
Heyy guys..can anyone pls provide me with droid bionic boot animation for our GT-i9003 device?? I am trying to downscale the original droid bionic boot animation resolution but it's not working..
Here is a boot animation I made for the Q. I first saw this stupid kitty on Rob Dyrdek's "Ridiculousness". I added Perfect Circle's "Weak and Powerless" as accompanying music. Pretty stupid, but that's what makes it good! This is my first boot animation and it came together nicely. I'll be making more now that I have the method down.
STUPID KITTY BOOT ANIMATION VIDEO : http://d-h.st/eYB ...SORRY, LINK DOWN...
STUPID KITTY BOOT ANIMATION SOUND: http://d-h.st/bzb ...SORRY, LINK DOWN...
Below is a link to a XDA member who developed an auto-install script for boot animations on the Photon Q, prepackaged with animations. Navigate to the animation folder and replace the 'sprint_bootanimation" file and the MP3 sound file "Express1024x600' with the two files linked above, flash, and it works beautifully!
http://forum.xda-developers.com/showthread.php?t=1965726
Download one of the Boot Animations on the first page WITH sound, make sure you navigate to the "animation" folder and replace the "Express" MP3 file with the one linked above, and the "sprint_bootanimation" file with the one linked above also.
Have Fun!
NOTE: The video is a stupid-looking cat with it's tongue sticking out and wagging up and down...strange...playing to the tune of a Tool/Perfect Circle track.
galacticservant said:
Here is a boot animation I made for the Q. I first saw this stupid kitty on Rob Dyrdek's "Ridiculousness". I added Perfect Circle's "Weak and Powerless" as accompanying music. Pretty stupid, but that's what makes it good! This is my first boot animation and it came out pretty good. I'll be making more now that I have the method down.
STUPID KITTY BOOT ANIMATION VIDEO : http://d-h.st/eYB
STUPID KITTY BOOT ANIMATION SOUND: http://d-h.st/bzb
Here is a link to a XDA member who developed an auto-install script for boot animations on the Photon Q. You can replace the 'sprint_bootanimation" file and the MP3 sound file "Express1024x600' with the two here, flash, and it works beautifully!
http://forum.xda-developers.com/showthread.php?t=1965726
Download one of the Boot Animations on the first page WITH sound, make sure you navigate to the "animation" folder and replace the "Express" MP3 file with the one linked above, and the "sprint_bootanimation" file with the one linked above also.
Have Fun!
NOTE: The video is a stupid-looking cat with it's tongue sticking out and wagging up and down...strange...playing to the tune of a Tool/Perfect Circle track.
Click to expand...
Click to collapse
Here is a photo of the Stupid Kitty:
Also, you may take any MP3, cut it to desired size and part, and rename it "Express1024x600". Then paste it in the "animation" folder and have any sound you wish playing during animation.
Moto Q stock with Arrrghhh's kernel v.0.10
galacticservant said:
NOTE: The video is a stupid-looking cat with it's tongue sticking out and wagging up and down...strange...playing to the tune of a Tool/Perfect Circle track.
Click to expand...
Click to collapse
My cat does that haha:laugh:
I would really like to install the Droid Boot animation with sound on my M8 and convert my M8 to a Droid Rom, with the custom ringtones, and wallpaper, and everything. Can you actually do this ?
cjegan2008 said:
I would really like to install the Droid Boot animation with sound on my M8 and convert my M8 to a Droid Rom, with the custom ringtones, and wallpaper, and everything. Can you actually do this ?
Click to expand...
Click to collapse
If you are rooted and have write access to system, yes, this is possible (and I do it all the time). I have a boot animation with sound that I prefer (and I have sound for my down animation as well).
The boot animation is stored as \system\customize\resource\vzw_bootup.zip. Its permissions are rw-r--r--.
Any audio should be in the same location (but that is not critical, as you'll see below).
You also need to edit a default.xml file with a text editor located in \system\customize\cid.
Find the following text in that file:
HTML:
<BootConfiguration>
<BootAnimation animation ="/system/customize/resource/vzw_bootup.zip" />
Add before the /> the following:
HTML:
audio="/system/customize/resource/filename.mp3"
Where filename.mp3 is the name of your audio. I have not tested it, but I suppose you could put that mp3 anywhere and as long as you point to it in the default.xml you may be good to go. (For that matter, maybe you can put the boot animation somewhere else, too, but, again, I have not tested this).
You can do the same with your down animation a few lines later, the key is to insert
audio="/system/customize/resource/filename.mp3" in the same line as the downanimation is identified and before />
As far as your own system sounds, etc., I regularly load the /alarms, /notifications and /ringtones folders with my own sounds. Sometimes I move them to /system, sometimes just keep them on the internal card.
One "gotcha," 99% of all errors with these changes are attributable to user mistyping and/or permissions not being properly set. So be careful.
I would like to thank you for your input. That's very much I informative, thanks. Now, I'm having an issue with the screen size. I used a droid razor boot animation, but the size of the animation was way to small. How do upscale the image size to fit the screen like the Verizon boot screen does ?
hgoldner said:
If you are rooted and have write access to system, yes, this is possible (and I do it all the time). I have a boot animation with sound that I prefer (and I have sound for my down animation as well).
The boot animation is stored as \system\customize\resource\vzw_bootup.zip. Its permissions are rw-r--r--.
Any audio should be in the same location (but that is not critical, as you'll see below).
You also need to edit a default.xml file with a text editor located in \system\customize\cid.
Find the following text in that file:
HTML:
<BootConfiguration>
<BootAnimation animation ="/system/customize/resource/vzw_bootup.zip" />
Add before the /> the following:
HTML:
audio="/system/customize/resource/filename.mp3"
Where filename.mp3 is the name of your audio. I have not tested it, but I suppose you could put that mp3 anywhere and as long as you point to it in the default.xml you may be good to go. (For that matter, maybe you can put the boot animation somewhere else, too, but, again, I have not tested this).
You can do the same with your down animation a few lines later, the key is to insert
audio="/system/customize/resource/filename.mp3" in the same line as the downanimation is identified and before />
As far as your own system sounds, etc., I regularly load the /alarms, /notifications and /ringtones folders with my own sounds. Sometimes I move them to /system, sometimes just keep them on the internal card.
One "gotcha," 99% of all errors with these changes are attributable to user mistyping and/or permissions not being properly set. So be careful.
Click to expand...
Click to collapse
cjegan2008 said:
I would like to thank you for your input. That's very much I informative, thanks. Now, I'm having an issue with the screen size. I used a droid razor boot animation, but the size of the animation was way to small. How do upscale the image size to fit the screen like the Verizon boot screen does ?
Click to expand...
Click to collapse
Way beyond my expertise. Suggest you poke around in the various threads that discuss creating boot animations. Since boot animations are series of jpgs, I suspect you need to resize each individual jpg in the animation, then recompile the animation.
Do you know anyone on here that may have a Droid boot animation that could fit the M8's screen size ?
hgoldner said:
Way beyond my expertise. Suggest you poke around in the various threads that discuss creating boot animations. Since boot animations are series of jpgs, I suspect you need to resize each individual jpg in the animation, then recompile the animation.
Click to expand...
Click to collapse
cjegan2008 said:
Do you know anyone on here that may have a Droid boot animation that could fit the M8's screen size ?
Click to expand...
Click to collapse
Not sure I catch your drift, you mean a Motorola Droid boot animation that already fits the M8? I imagine you could post a request in the Q&A forum of the M8. Or you could look for the boot animation threads and see how you could do one yourself.
Take a look here, here, here, here or here.