Creating a render class and defining a main activity

In order to see anything on the screen, we have to render it on screen. Therefore, we need to create a render class that will handle the rendering part of our functioning. Rendering is the process of generating an image from a 2D or 3D model by means of computer programs. We will name our render class as MyGLRenderer, but before we do that, let's define our main activity. So, open up your file, and we will create three default methods there. Remove everything you see on screen, except for the first line that's your package name. We will have three methods:

  • onCreate(): This initializes our main activity
  • onPause(): This handles the app if it goes into background
  • onResume() ...

Get Learning Android Game Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.