20

Is there a detailed explanation of Surface, SurfaceHolder, EGLSurface, SurfaceView, GLSurfaceView, SurfaceTexture, and TextureView?  In particular:

  • What’s the difference between SurfaceView and TextureView?
  • Do I need to use GLSurfaceView to use OpenGL ES?
  • How do Surface and EGLSurface interact?
  • What does SurfaceTexture do?
  • Why does the stuff I draw on a SurfaceView have to go above or below everything else?
  • What is SurfaceFlinger?
  • How does composition of the status and navigation bars work?
  • While we’re at it, what’s the right way to structure a game loop on Android?
fadden
  • 51,356
  • 5
  • 116
  • 166

1 Answers1

22

The answers to these and many other questions can now be found on the Android Open Source Project web site:

Android System-Level Graphics

The document begins with an explanation of the low-level infrastructure, and then explains how the higher-level features are built from them. The goal is not to provide direct answers to common questions, but rather to describe the system at a level of detail that makes the answers apparent without being overwhelming.

The choice of material and level of detail were heavy influenced by Q&A on stackoverflow.

(Technically this is a link-only answer, but writing 10,000 words here seemed like a bad idea.)

fadden
  • 51,356
  • 5
  • 116
  • 166
  • 1
    I like how the question and the response are written on the same minute. – Léon Pelletier Jun 11 '15 at 02:36
  • Thanks, I didn't know it was instituted. But I was more surprised about the 0 minute delay. – Léon Pelletier Jun 11 '15 at 18:24
  • Hello fadden! Thanks for the great writing. May I ask a quick question btw? Is it possible to take a screenshot of a SurfaceView? I've been searching for this but so far it seems I can't.. I don't expect you to explain how to do it here but I just want to know if there is really any way like calling `draw()` on normal Views. – Jenix Sep 26 '18 at 11:30