The latest Admob advertisement release process (in practice ):
Step One log on to admob and register a user
Log on to http://www.admob.com/and use the googleaccount number to log on.
After Step Two logs on to admobSites and ApplicationsOption
Select and add an android Application
Note:ApplicationsAfter, SetApplication advertisement settingsAnd record the publisher ID:11119a2c6ff2759
Step Three download admob sdk
Http://code.google.com/intl/zh-CN/mobile/ads/download.html download path
Step Four unzipping SDK, the app loads the GoogleAdMobAdsSdk-4.1.1.jar In the sdk
Step Five adds advertisement (Code Method):
- In the AndroidManifest. xml file
Join:
<Activity android: name = "com. google. ads. AdActivity"
Android: configChanges = "keyboard | keyboardHidden | orientation"
/>
// Permission section:
<Uses-permission android: name = "android. permission. INTERNET"/>
<Uses-permission android: name = "android. permission. ACCESS_NETWORK_STATE"/>
/** Called when the activity is first created. */
private AdView adView;
// Create the adView
adView = new AdView(this, AdSize.BANNER, "a14e9a2c6ff2759");
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout) findViewById(R.id.mainLayout);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad a
adView.loadAd(new AdRequest());