I am going through test example. Where for some Image background they are using gradient, the code goes like this
Gradient basically represents the variation in space(in a direction) of any quantity. With color it represents the variation of color intensity in a direction represented by angle. Here are some diagrams to represent this concept:

Here the figure shows the color variation in horizontal direction (angle is set 0).
XML code:

Here the figure shows the color variation in vertical direction (angle is set 90).
XML code:
You can also use different color as start, center and end colors. The code you attached contains all these elements.