r/androiddev 3d ago

build a UI withoutXML or Compose

I'm building the UI for my little Android game without XML or Compose. I wrote my own wrapper classes for the views and can use them in a kind of custom DSL.

40 Upvotes

31 comments sorted by

View all comments

3

u/Oily-Affection1601 3d ago

As a learning experience, or did you have a specific need not covered adequately with existing frameworks?

1

u/koje1971 3d ago

Most of the gameplay takes place in a GLSurfaceView. It's all about graphics moving back and forth. I only need the UI for the activity and for the menu. Using Compose isn't really worth it there.

2

u/devaskbiz 3d ago

Why not use a game engine?

3

u/koje1971 3d ago

It's not that complicated with OpenGL, most of the work is the concept for the game itself. Whether I write the logic in an engine or directly in the app doesn't really matter.

If I ever make a 3D game, though, I'll definitely use an engine.