6.14 Wrap-Up
In this chapter, you created the Cannon Game app, which challenges the player to destroy nine targets before a 10-second time limit expires. The user aims and fires the cannon by touching the screen. To draw on the screen from a separate thread, you created a custom view by extending class SurfaceView. You learned that custom component class names must be fully qualified in the XML layout element that represents the component. We presented additional Fragment lifecycle methods. You learned that method onPause is called when a Fragment is paused and method onDestroy is called when the Fragment is destroyed. You handled touches by overriding View’s onTouchEvent method. You added sound effects to the app’s res/raw folder and managed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access