First, thanks for bringing this capability to my attention. I have been developing an Android app, and did not realize I could make such a tool bar. After seeing this post, I looked around at other apps and noticed it prominently along the top. So now I am doing the same thing: adding this to my app.
To do it, I am starting with their tutorial at
https://developer.android.com/training/appbar/setting-up.html , which first tells you that you must extend AppCompatActivity for any Activity that needs a toolbar.
Right now, as I write this, I am updating my environment so this class exists
to be extended. That is actually taking a surprisingly long time. Perhaps I should have installed only a subset of the things suggested. Either way, when I get this right, I will post whatever gotchas I've run into.