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 ...
Get Android How to Program, 3/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.