Friday, March 9, 2012

Creating a Simple Custom Android View

This tutorial will show you how to create an extremely simple custom view that draws a red border, and add this view to a layout.

1. Why Create a Custom View?

You may be wondering why you would ever want to create a custom view. Android comes with many views already, and these views follow behaviors that the user expects and has grown accustomed to (buttons, check boxes, text inputs). These views are fine and work great, but sometimes they do not provide all the functionality that your apps requires, or you may simply wish to build a more customizable component.