Hi,

Emulator is really slooooooooooooooooooooooooow, you should not measure
your app performance based on emulator results.

The speed of an animation depends on the speed of the device: the faster
the device, the faster the animation.

You must use some kind of method to sync your animation framing so it
runs at same speed on all devices. For example, if you plan to show 25
frames per second, i.e. one frame every 40 milliseconds, you may
calculate the time for next frame based on System.currentTimeMillis() + 40.

It should be something like:


// Init this value on the constructor, for example
nextFrameTiming = 0;

...

// This could be wherever the image its drawn or prepared to be drawn,
depending on how your code works
if ( System.currenTimeMillis >= nextFrameTimming ) {
    nextFrameTiming = System.currentTimeMillis() + 40;
    changeFrame();
}

So you only change to a new frame as fast as once each 40 milliseconds.
Note that this will be useful to make the animation slower in devices
where it runs too fast, but obviously it will not made it to run faster
in devices where it runs too slow due hardware limitations.


On 24/06/12 14:00, ala hammad wrote:
> Hello all ,
> i want to ask why when animate activity show slow in emulater but in device 
> show very fast ..
> how to make it slowly to show it to user ???
>


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to