How to structure simple Android apps

I am having an organizational problem with the application I'm working on on the Android platform. The application uses sensors as input and OpenGL as output.

  • The traditional method is something like organizing a project in MVC, where in my main vision the class loads the OpenGL view and the sensor processing class and then probably register some callbacks or maybe do it on the clock.
  • A sloppy alternative has one class that implements GLSurfaceView and SensorEventListener, and then offloads the logic into other classes.

Suppose a very simple drawing code and a somewhat complex control system code that attempts to update at 60 Hz. I am looking for performance, maintainability and easy developmental consequences, that's why all and all information is important. Also, I'm a complete newbie when it comes to Android or mobile development, so if you can show me the light with a third alternative, that would be great too.

+3
source share
1 answer

Sometimes excessive planning can be a waste of time.

, dev , GLSurfaceView. http://replicaisland.net/

, , . - GLSurfaceView, , . (onDraw, onTouch, onKey ..)

, , . , onDrawFrame() MyAreaManager.draw(gl)

MyAreaManager , .

, , , . ( GLSurfaceView) , .

canvas, .

- .

+1

Source: https://habr.com/ru/post/1762489/


All Articles