Add admob to your application

The new AdMob library requires Android SDK level 13 or above. You will need to download it with the SDK Manager and then choose Tools – Configure Paths and choose android.jar from platforms\android-13.

Use The new Ad-Mob library you can earn money by displaying ads in your applications.

Installing Procedure Given Below.

1. Go to Admob Website And Register your account.

2. Then login to your account.

3. Now, Go to Add Site/App To create any site or app. And Fill out the site or app form.

4.  After creating your application you should see a screen with your “Publisher ID” and link for “get publisher code“. it is unique Publisher ID
Later you will need to enter your publisher id in the program code. Now you should download AdMob SDK by pressing on “get publisher code“.
You will download a zip file with a name similar to: GoogleAdMobAdsSdk-6.0.0.zip.
Inside the zip there is a folder with the same name. Inside this folder you will find the required jar file (GoogleAdMobAdsSdk-x.x.x.jar).

5. Copy GoogleAdMobAdsSdk.jar to your additional libraries path.

Now, Add Admob To your application

1. First, add libraries to your android app (GoogleAdMobAdsSdk.jar)

2. Then Add This Code.

// Lookup R.layout.main
LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout);

// Create the adView
// Please replace MY_BANNER_UNIT_ID with your AdMob Publisher ID
AdView adView = new AdView(this, AdSize.BANNER, AdMob Publisher ID);

// Add the adView to it
layout.addView(adView);

// Initiate a generic request to load it with an ad
AdRequest request = new AdRequest();

// request.setTesting(true);

adView.loadAd(request);

3. In manifest File. Add this Code.

<activity
android:name=”com.google.ads.AdActivity”
android:configChanges=”keyboard|keyboardHidden|orientation
|uiMode|screenLayout|screenSize|smallestScreenSize” >
</activity>

4. Also Add internet permission

<uses-permission android:name=”android.permission.INTERNET” />

5. And Now Run This Code.

More Code…

>>   Twitter OAuth – Authentication In Android

>>   IPhone UITable View In Android

>>   Full Screen Activity In Android

>>   Add Admob To Your Application

>>   Page Curl Effect In Android