java - AdMob Ads on Android Canvas GamePanel -
i want place admob adbanner on canvas surfaceview. (a class extends surfaceview , implements surfaceview.callback). solutions place view on top? example basic button.
actually don't need add inside surfaceview, add on surfaceview's parent viewgroup after add surfaceview.
pseudo example:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <surfaceview android:id="@+id/surface" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerinparent="true" /> <com.google.ads.adview xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/ad" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" ads:adsize="banner" ads:adunitid="xxxxxxxxxxxxxxxxxx" android:visibility="visible" /> </relativelayout>
the same can achieved using code instead of xml...
Comments
Post a Comment