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 can even make our code simpler and easier to understand.
We will have four classes in the Live Drawing app:
LiveDrawingActivity
: TheActivity
class provided by the Android API is the class that interacts with the operating system. We have already seen how the OS interacts withonCreate
when the player clicks the app icon to start an app. Rather than have a class calledMainActivity
that does everything, we will have an Activity-based class that just handles the startup and shutdown of our app, as well as giving some assistance with initialization by getting the screen resolution. It makes sense that this class will be of theActivity
type. However, as you will soon see, we will delegate interacting with touches to another class, the same class that will also handle...