
Learning Java by Building Android Games
By :

Let's create another new project to explore the topic of drawing with Canvas
. We will reuse what we just learned and this time we will also draw to the Bitmap
.
Create a new project in the same way as we did for Sub' Hunter, but call it Canvas Demo
. If you have the Sub' Hunter project open now, you can select File | New Project and create a project using the following options:
As we did before, be sure that the Empty Activity option is selected. Don't worry about refactoring the name of the activity. This is just a mini-app to play around with; we will not be returning to it.
Important note
The complete code for this mini-app can be found on the GitHub repo in the Chapter 5/Canvas Demo
folder.
To get started, edit the autogenerated code, including the class declaration, to change the type of Activity
class, add the related import
statements, declare a few...