Most suitable API - Opengl ES 2.0 x Canvas x Drawable

Asked

Viewed 218 times

0

Good morning,

I would like to make an application for Android to do the following: display the plan of a home on mobile, and the user touch a room on the screen, the color of the room change.

I’m familiar with Opengl ES 2.0, and I think it’s an excellent tool for graphics, but I’ve never yet fiddled with Canvas and Drawable.

What is the most suitable API for me to use in my application?

Thank you,

1 answer

1

Opengl x Canvas

Opengl will give you full control over the graphics you are using. You won’t have too many long-term limitations on what you’d like to do. You can do a good 3D design on an Android using Opengl, as you can process large quantities of polygons and overlay 2D graphics on top of anything. It’s a lot of work, though.

The main difference is that Opengl is much faster compared to Canvas (2D Graphics Android surface drawing). Although hardware acceleration is enabled for Canvas, it is somewhat difficult to use it effectively.

Canvas makes life easier. It’s easy to use and simple to understand, even for someone new to Computer Graphics.

In the end, it will depend on what you need to do. If you need fancy things like geometry, lighting etc, then you should definitely go for Opengl. Also, if you need then Opengl 3D is your only option, since Canvas only supports 2D graphics.

Drawble: A simple way to add graphics to your application by referencing an image file from your project resources. Supported file types are PNG (preferred), JPG (acceptable) and GIF (discouraged). This technique would obviously be preferred for application icons, logos or other graphics such as those used in a game.

Source: http://developer.android.com/guide/topics/graphics/2d-graphics.html

Source: http://developer.android.com/training/graphics/opengl/index.html

Browser other questions tagged

You are not signed in. Login or sign up in order to post.