Learning Android Canvas

If you want to create 2D graphics for Android from scratch, this book is the perfect guide. It covers all the angles of using Android Canvas with a step-by-step approach to give your apps the graphical edge.
Preview in Mapt

Learning Android Canvas

Mir Nauman Tahir

If you want to create 2D graphics for Android from scratch, this book is the perfect guide. It covers all the angles of using Android Canvas with a step-by-step approach to give your apps the graphical edge.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$12.60
RRP $17.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$12.60
$29.99
$29.99p/m after trial
RRP $17.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Learning Android Canvas Book Cover
Learning Android Canvas
$ 17.99
$ 12.60
Learn Kotlin by Developing Android Apps [Video] Book Cover
Learn Kotlin by Developing Android Apps [Video]
$ 124.99
$ 106.25
Buy 2 for $30.10
Save $112.88
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781783285396
Paperback108 pages

Book Description

When you're writing an application in which you would like to perform specialized drawing and/or control the animation of graphics, you should do so by drawing through a canvas. A canvas works for you as an interface to the actual surface upon which your graphics will be drawn — it holds all of your "draw" calls. Via the Android Canvas, your drawing is actually performed on an underlying Bitmap, which is placed into the window.

Learning Android Canvas is a practical guide, which will help you develop applications that contain rich 2D graphics like backgrounds, buttons, and even some small games with static 2D graphics. The book is full of step-by-step lessons and practical examples. This book helps you develop rich graphical applications and some simple games.

Learning Android Canvas will help you understand everything that is required to develop an Android application that involves creating 2D graphics from scratch to a fully functional complete application. You will start with zero knowledge of using graphics within Android applications and will then go step by step to learn about different objects and techniques. In the end you will be able to develop a complete application fully loaded with graphics and functions.

The book will give you a detailed practical explanation of Nine-Patch images and its importance in designing layouts and backgrounds. We will also take a detailed look at user interactions such as touch, capturing the action, and responding to them accordingly. Finally we will have a working, fully functional graphic application that uses all the knowledge that we have acquired previously.

Table of Contents

Chapter 1: Getting Started with Android Canvas
Android Canvas
Our first Android Canvas application
Mining our first application
Summary
Chapter 2: Drawing Threads
The need for drawing threads
The issue with multithreading in Android
The Thread class
Summary
Chapter 3: Drawing and Drawables in Android Canvas
Drawing on a Canvas
Shape Drawables
Summary
Chapter 4: NinePatch Images
Creating a NinePatch image
Using a NinePatch image
Summary
Chapter 5: Touch Events and Drawing on Canvas
Some background knowledge
Application development
Summary
Chapter 6: Putting it All Together
The story board
The project and application development
Summary

What You Will Learn

  • Create a drawable thread to take away the load from the main thread
  • Develop important drawables and shapes
  • Understand the actions performed by users, capturing them, and responding to them
  • Unfold the basics of nested layouts
  • Design your own View classes and use them in the main class
  • Discover the graphics used as backgrounds of the whole screen or controls like buttons
  • Draw on the Android Canvas and Views
  • Set up the listener for touch events

Authors

Table of Contents

Chapter 1: Getting Started with Android Canvas
Android Canvas
Our first Android Canvas application
Mining our first application
Summary
Chapter 2: Drawing Threads
The need for drawing threads
The issue with multithreading in Android
The Thread class
Summary
Chapter 3: Drawing and Drawables in Android Canvas
Drawing on a Canvas
Shape Drawables
Summary
Chapter 4: NinePatch Images
Creating a NinePatch image
Using a NinePatch image
Summary
Chapter 5: Touch Events and Drawing on Canvas
Some background knowledge
Application development
Summary
Chapter 6: Putting it All Together
The story board
The project and application development
Summary

Book Details

ISBN 139781783285396
Paperback108 pages
Read More

Read More Reviews

Recommended for You

Learning Android Intents Book Cover
Learning Android Intents
$ 26.99
$ 18.90
Android User Interface Development: Beginner's Guide Book Cover
Android User Interface Development: Beginner's Guide
$ 26.99
$ 18.90
Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Creating Dynamic UI with Android Fragments Book Cover
Creating Dynamic UI with Android Fragments
$ 23.99
$ 16.80
Android Application Testing Guide Book Cover
Android Application Testing Guide
$ 26.99
$ 18.90
Android NDK Beginner’s Guide Book Cover
Android NDK Beginner’s Guide
$ 29.99
$ 21.00