Little indicators to show which buttons do something

On most of the pre-installed widgets, there are indicators that show me which buttons i might try using.

E.G

  • on my weather widget, there are 4 dots vertically stacked on top of each other representing the 4 pages that i can up/down-scoll through (one of the dots is filled out representing the current page)
  • one of those pages has itself 3 sub-pages that appear as 3 dots right next to the start/stop-button on my fr945
  • some other pages indicate that you can drill down with the start/stop-button by drawing a little bar right next to it

My Question:

If I want something similar for my widget: Do I have to create these animations myself or is there some predefined API or sample-code I can use?

Thx