1. First create a class to inherit the view
2. Override the ondraw (canvas) Method
3. Implement a paint class. This class can be viewed as a paint brush and can be used to set attributes such as color and line.
4. Use canvas to draw images on the screen
6. Implement the class that inherits the view in an activity class
7. Add the class to the view or view Container Using addview () method to display it on the activity.
8. (optional) You can create a setontouchlistener listener for this custom view to implement animation.
9. Note that you need to call invalidate () for re-painting in the UI thread; if not in the UI thread, you need to call postinvalidate ();