Thanks for the response, you are actually getting a better framerate
than I am and I'm using OpenGL.
However, my approach is pretty simple.  I load a bunch of png images
and just draw them (some sprites may be drawn twice) there is a lot of
room for improvement.

However, my game is 2D with simple tile animations, the scene is only
updated when a character moves.
This is why I use 'RENDER_DIRTY' with OpenGL which means it doesn't
render the scene as fast as possible but only when the scene has
changed.
This made my app reduce about 50% CPU usage which means better batter
life.  Just something to put out there, framerate is not necessarily
the ultimate goal when making a game for Android.

Even with some movement the framerate only goes up to 7FPS or so and
it looks the same as if I had it rendering as fast as possible (which
I get like 20 - 30FPS.)

Handling input is a pain, I remember watching a talk on Replica Island
where the author mentions implementing an input queue.
I hadn't done this until I started having some issues with sleeping in
the onTouch() method and receiving callbacks from my service (which
runs in the same thread as the UI thread.)

I'm just pretty much using queues now for both the network calls and
the onTouch calls to keep everything in order in the UI/render thread.

On Tue, Nov 23, 2010 at 3:48 AM, Ruben <[email protected]> wrote:
> Hi Miguel,
>
> I'm getting solid 60 fps on my Samsung Galaxy Spica (800 mhz
> processor) for most levels. I have heard that does not work so well in
> the HTC Magic...
> CPU load is quite balanced between updating the scene and rendering
> it, thus I could improve performance by optimizing the update phase
> (collision detection is a good candidate) without changing the canvas
> approach. I am an OpenGL lover, but unfortunatelly my phone has poor
> support for it :(
>
> The biggest problem was the handling of input events. It hurts
> performance a lot by default. My solution is to save every motion
> event data in the same variable, and processing the most recent one in
> the main render loop/thread. This, incidentally, avoids some thread
> synchronization problems.
>
> On 23 nov, 09:13, Miguel Morales <[email protected]> wrote:
>> Nice, I enjoyed the part of content creation.  I'm going to keep your
>> suggestion of using a single bitmap with all the sprites instead of
>> individual images.
>> Although it's not terrible it does indeed have a performance impact.
>>
>> Are you getting good performance using this approach with canvas alone?
>> In either case, good job.
>>
>>
>>
>>
>>
>> On Sun, Nov 21, 2010 at 2:51 PM, Ruben <[email protected]> wrote:
>> > I have just written an in-depth article covering the workflow of 2D
>> > game creation for Android with blender, based in my own experience
>> > with the game "Egg Savior". I hope you find it usefull.
>> > Feel free to share your knowledge and propose other alternatives to
>> > these ideas.
>>
>> >http://organicandroid.blogspot.com/2010/11/creating-2d-games-with-and...
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>>
>> --
>> ~ Jeremiah:9:23-24
>> Android 2D 
>> MMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/revoltingx
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://developingthedream.blogspot.com/,
http://www.youtube.com/user/revoltingx

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

Reply via email to