Drawing on an android view
I am building a simple app that will need to graph some data, so I found myself in the need of using Android’s drawing library. There are a few good tutorials out there of how to do this using a canvas, but I read somewhere that it was possible to draw directly into a view and I wanted to try that. Drawing directly into the view is useful when you have data that you don’t need to redraw very often. When you use a canvas you have to manually call the onDraw method every time you want to show something, which makes sense for animations. For more static data you can draw directly into the view and the onDraw method will be called automatically every time the view it is shown to the user.