-3
\$\begingroup\$

The problem is that my java app contains too many animated sprites and it runs very slowly on android system.

Does the usage of .gif animation instead of sprite animation will improve the speed?
I really don't know which animation technique consume less CPU time.

\$\endgroup\$
6
  • \$\begingroup\$ Can you provide us some additional information on how you're displaying sprites? For example, are you using SurfaceView? Are you using RGB_565 for sprites? ARGB_4444? Are you using pooling and recycling techniques? \$\endgroup\$ Commented Mar 3, 2013 at 1:42
  • \$\begingroup\$ In a main app loop I check for the delay between frames and post a part of a ARGB sprite sheet onto a surfaceView. \$\endgroup\$
    – qvatra
    Commented Mar 3, 2013 at 2:09
  • 2
    \$\begingroup\$ What you're really asking is how to optimize graphics performance on Android. It's a big topic and there are many things you can do, but using a gif is not going to solve all your problems. \$\endgroup\$ Commented Mar 3, 2013 at 2:22
  • \$\begingroup\$ true but using gifs I don't have a connection of gif's speed with the java code, right? The question is still: will gifs improve a speed of the app or not? \$\endgroup\$
    – qvatra
    Commented Mar 3, 2013 at 2:32
  • 5
    \$\begingroup\$ Grab a profiler and see what it tells you. There's no substitute for that. \$\endgroup\$
    – ashes999
    Commented Mar 3, 2013 at 3:24

1 Answer 1

1
\$\begingroup\$

Whether you are able to render .gifs acceptable for your needs (frame timing, alpha channel) or not? It all depends on implementation. But the resulting app's size will not be reduced, if the device's memory is a considerable bottleneck.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .