Looking ahead at the Live Drawing app
As this app is more in-depth and needs to respond in real time, it is necessary to use a slightly more in-depth structure. At first, this may seem like a complication, but in the long run, it will make our code simpler and easier to understand.
We will have four classes in the Live Drawing app, as follows:
MainActivity
: TheActivity
class provided by the Android API is the class that interacts with the operating system (OS). We have already seen how the OS interacts withonCreate
when the player clicks on the app icon to start an app. Rather than have theMainActivity
class that does everything, thisActivity
-based class will just handle the startup and shutdown of our app, and offer some assistance with initialization by calculating the screen resolution. It makes sense that this class will be of theActivity
type and notAppCompatActivity
. However, as you will soon see, we will delegate interaction through touches to another class, that is, the same...