Download the AdMob jar file http://www.admob.com/my_sites/
Create a package in your project and name it "libs" and paste this AdMob.jar file there
Right-click on your project, select the library, add the path for the just saved ADMOB.jar there.
If you create your AdView on your XML, you can add this line
This is an example of testing. When you get your own ID from ADMob, put it on adUnitID and erase the test line.
com.google.ads.AdView android:id="@+id/adView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" ads:adSize="BANNER" ads:adUnitId="a14f59e5c442767" ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" ads:loadAdOnCreate="true" </com.google.ads.AdView>
Now go to your .java so that it invokes this layout and creates an AdView
AdView adView = (AdView)this.findViewById(R.id.adView1); adView.loadAd(new AdRequest());
This is how I do it, and it still works.
Sorry for the bad english, a lot of code and no sleep!
LuizAurio
source share