I am having a hard time integrating an Admob banner into my game. I have used simple-xml-2.6.2.jar library because I considered it to be simple to implement into my game. Now I have a single layout file, with the correct code for publisher ID and test device:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="xxxxxxxxxxx"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, zzzzzzzzzzzz"
ads:loadAdOnCreate="true"/>
</LinearLayout>
The game runs in landscape mode, and I would like tu get the ads to show as a banner at the top or bottom, but there aren’t any test ads being shown, and I haven’t got any ideas as to why is that.
Any help is apreciated!
Use below code in xml say xml name is
adview.xmlNow in your Activity load the ad.
You can include this view(xml) in any of your activity from xml like this..