Search code examples
androidperformanceandroid-canvassurfaceview

Android Surface View enough performance?


I developed already a few apps with Android Studio and i learned the last 3 years java so i would not like to change the language. Now i want to Programm a game but i am not quit sure. I read about the surfaceview and performance problems, and now i want to ask:

Does the surface view has enough power to render a 2d 16 bit RPG in a canvas?

I tried to make a demo and i had a few perfomance problems but I think the reason for this was that i resized the graphics every time befor i drawed it.

Thank you for your Help,

Julius


Solution

  • I would bet it does.

    I made a 2d scroller shooter with light effects and shadows and it works smoothly on an pretty old samsung phone.

    I used libgdx as a base library.

    Also about the resizing graphics in every frame. This is very bad practice. You should decode and resize all graphics (where possible) in an initialization method before starting the playing mode. Then you can reuse resized bitmaps in each frame which will be much faster.