The Canvas Demo app

Create a 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 and call it Canvas Demo. This time, be sure to choose the Empty Activity option 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 an app to play around with. We will not be returning to it.

Notice that Android Studio has not created an XML layout, and furthermore it has not added a line of code in MainActivity.java that calls setContentView. If you ran the app at this stage, you would get ...

Get Android Programming for Beginners - Second Edition 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.