The Canvas Demo app
First, create a new project to explore the topic of drawing with Canvas
. We will reuse what we have learned and, this time, we will also draw to the Bitmap
instance.
Creating a new project
Create a new project and call it Canvas Demo
, and make sure that you choose the Empty Activity template option.
In this app, we will make a change that we have not seen before. We will be using the vanilla version of the Activity
class. Therefore, MainActivity
will inherit from Activity
instead of AppCompatActivity
, as has been the case previously. We are doing this because we are not using a layout from an XML file, and so we have no need for the backward compatibility features of AppCompatActivity
as we did in all the previous projects.
You ...
Get Android Programming with Kotlin for Beginners 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.