Canvas Demo app
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
.
Creating a new project
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.
Option |
Value entered |
---|---|
Application name: |
Canvas Demo |
Company domain: |
gamecodeschool.com (or your own) |
Include C++ support |
Leave this option unchecked |
Project location: |
D:\AndroidProjects\CanvasDemo |
As we did before, be sure the Empty Activity option is selected on the Add an Activity to Mobile screen before clicking Next. Also, be sure to uncheck Generate Layout File and Backwards Compatibility (AppCompat). Don't worry about naming the Activity this is just a mini app to play around with we will not be returning to it.
Note
The complete code for this mini-app can be...