Incorporating ads into a canvas

As some of you may know from other various posts I have made I am nearing completion of my first game for the android platform, all I have left is some minor tweaks and incorporating ads into the game. I am having a bit of an issue incorporating the ads… my game is drawn using a surfaceview, and all game objects are drawn to a canvas which is then drawn to the screen. The game engine I am using is a modified version of the one available in mario zechners begining android developement…

I have imported the necessary jar file from admob and am able to create an AdView, but do not have any idea on how to apply the view to the canvas… the tutorials I have found online including the one available from google all draw the ads using layouts(linear, relative, etc) but I have no layouts defined…

If there is any more information that would help you help me please ask and I will gladly respond as quickly as possible…

I assume you have solved this somehow since the topic is so old, but I answer anyway if someone else is pondering the same thing. I also use surfaceview in my game and show an ad banner in the bottom of the view. Just define the layout for your game and include your custom view (which draws to the surfaceview) and the adview in the layout. I use RelativeLayout but LinearLayout should work just fine also. So, define something like this:


<.YourCustomGameView
    android:id="@+id/gameView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginBottom="50dp" />

<com.google.ads.AdView android:id="@+id/ad_view"
    android:layout_height="50dp"
    android:layout_width="320dp"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true" />