[C++ or Other Android Development Languages] Petr Sovis:
Hi matheszabi,

ok, your question was rather compheresive :). So right way to find solution is rather complicated too.

I woudn't choose solution according to differences between JDK / NDK to same function calls of OpenGL ES 2.0

According to my experience, performance (and power consumption) is almost the same.

GLOBAL aproach: I suggest

1) you create your application in Java - use JDK versions - creating native function for just few draw calls is, imho, hard compared what you get

2) if your application is NativeActivity

- use direct calls - be prepared for differences between devices, proper creation of surface, .... but it's faster

- subclass Native Activity and use JAVA as well :)

3) not using OpenGL ES directly at all - i suggest trying layout and buttons / images inside of it, i saw 200 control buttons on 1 screen and it ran perfectly. And layout is movable by 1 command - offset. I suppose, this is completely written in native code anyway. You just get drawing interface in JAVA.

Now, to OPENGL ES itself (JAVA or NDK)

cons:

- OPENGL is 3D interface so pixel perfect drawing is something which is not supported by itself. (note: opengl has pixel / texel center at 0.5 not at 0.0/1.0)

- you need pixel perfect draw - boxes you draw must be perfectly aligned to screen pixels - othewise you get blurry results

- you might not need texturing - thats PLUS, otherwise drawing pixel perfect opengl suraces is "pain in the ..." - viz. texel interpolation and drawing a pixel checker aligned with screen pixels is real nightmare and it differs on each device (I tried :) )

- pixel perfect with mipmaps - awful again :)

- alpha blending (when you have something which is transparent) - you will need sorting to draw it properly

- will you need font ? oh my ...

- NO EMULATOR - will need to test each device if it's working properly (not every, at least each vendor)

to consider:

writing vertex/fragment shader in a world with 3500 (number of opengles 2.0 devices according google) suitable devices/compilers/android versions ... ehm

pluses:

- you draw exactly what you want

- use of fragment shader (alhough i suggest using gradient textures instead)

- i suggest draw primitives in vertex buffers (indexed triangles or triangle strips). Not one box by one - compose all in one array and draw it by one draw call. Doubling points in strips can help you

- instancing is not supported) but there is way surpassing this (preparing buffers with)

- i don't recommend using lines with width definition - each implementation draws this differently - and it's equal to drawing lit cylinder

- in native activity loop - handling if you need redraw - it's difficult

I would try normal android GUI first

pluses:

- you get pixel perfect draw, with / without bitmaps, images, gradients ....

- i suppose its fast enough

- no sorting needed

- redraws will be invoked when something changes

- translation / clipping will be handled internally

- no need to care about device !!! that's big plus

cons:

- zoom will be problematic

- rotations as well (but i suppose you don't need them)

note to power consupmption - both OpenGL :

just swaping screen buffers 30 per sec will deplete most of devices within 2-3 hours. But of course, doing it so only when needed is doable

But I might be wrong :) so best way is to decide by yourself and, of course, try it and see.

If you have qustions about drawing through ES, i'll post some samples of pixel perfect draw (from my gui)

Good luck, post your decision, and if you have some results, post them too! will be very interesting.

PS.