Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am new at Android game development. I have done some apps before, but none of them are games :)

So, I wanted to do a frame-by-frame animation of PNGs. I tried with AnimationDrawable, but OutOfMemory error comes quickly (I have a lot of PNGs). So I came upon SurfaceView. But I am stuck, because I really don't find any useful tutoirals/examples.

What is the best way to make an animation like this?

Here there already is a great answer to almost the same question, but all the links there don't work anymore.

I would really like to here suggestions how to make an animation frame-by-frame with PNGs in Android and if you have any tutorials or examples, I will be really happy :)

EDIT

I thought wrong about sprites, I think... Sorry, but I am a noob at game developing :) I have 60 PNG pictures (40kb, 427*420px each - on disk) which I would like to put in a animation. Is this even possible to do it with frame by frame animation?

The most similar and famous game that is close to mine is Talking Tom (but I don't know if they have frame-by-frame or any other method for animation).

share|improve this question
1  
The links are broken because someone linked to code search which was abandoned but the replica island codebase is still online: code.google.com/p/replicaisland/source/browse/trunk/src/com/… –  Rubber Mallet Apr 6 '12 at 15:44
    
Maybe if you make all your pngs fit in just one, as a sprite sheet, the OutOfMemory error may get fixed. –  Gustavo Maciel Apr 6 '12 at 16:28
    
Thanks for all, I think that replica island will be the best example! –  Trick Apr 7 '12 at 11:01
    
Trick and @Rubber Mallet, thanks for the heads up about the links, I've updated my answer to the linked Android animation question. –  Martin Foot Apr 9 '12 at 8:07
add comment

1 Answer

up vote 1 down vote accepted

The Android APIs (like SurfaceView) are only really helpful for the simplest style of games like a simple puzzle game with no animations. If you are looking to create a game with a number of animated characters and any kind of complex gameplay, you're going to want to go another route. I suggest using OpenGL ES for the graphics and either a physics library like Box2D or build off of an existing engine like AndEngine. It really depends on what kind of game you want to make.

share|improve this answer
    
Box2D may require NDK, and programming Android apps on C++ may not be user-friendly at first... –  Gustavo Maciel Apr 6 '12 at 16:27
    
Not true, I'm currently writing a game with JBox2d without using the NDK. –  Amplify91 Apr 6 '12 at 16:29
    
So mention JBox2D instead of Box2D :O And also, I've heared that JBox2D isn't nice, cause garbage collector is not well implemented for games in android mobiles. That's why Box2D on C++ comes as an answer, YOU decide where the object gets deleted, so the game won't have "hiccups" . But anyway, this have nothing to do with the question (: –  Gustavo Maciel Apr 6 '12 at 16:37
2  
JBox2D, like many other ports, is still Box2D. It's just a port so no need to get overly specific. As far as the Java v. C++ debate (far outside of the scope here), proper game programming in Java can completely avoid "hiccups" and improper garbage collection. Whether or not it's "well implemented" is up to the programmer doing the implementing. –  Amplify91 Apr 6 '12 at 20:56
    
Up to the programmer of course :) I will look into it, I am familiar with C++, so that is not a problem. –  Trick Apr 7 '12 at 11:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.