SurfaceView is a view with a surface. It is a sub class of android.view.View. So it is similar with other views, it can receive user input on the screen, it also inherits all view life cycle callback functions.
Android Custom View
android.view.SurfaceView is a sub class of android.view.View. It is used to create custom view in android game development. It do not has onDraw method, but you can get and use android.view.SurfaceHolder object to get and lock the view canvas, and then paint on it. This example will show you how to use it.
When you play game, you will find the arrow key is a good control method to move the view object in your screen. This example will show you how to use keyboard arrow key to move text view in android screen. It also demonstrate how to make the text move follow your finger touch by …