How to extend Activity (Android)?

So it is my understand that every Android app extends ‘Activity’. Thus when you create a game in Unity and build it for Android, Unity creates some class for your game that extends Activity.

How can I write code to be put in this Activity extension class? Specifically, I want to add banner ads without buying an asset for it, using something like the following code: AdMob  |  Google for Developers