Android Admob setup - Android Developement

When you are working on developing your own applications for mobile phones, it is good to monetize them to generate income out of it. Admob is very useful for this purpose both in Android development and iOS development. This tutorial is for showing how to setup the admob for android applications.

First step in doing that is to create an account at Admob to get your Admob publisher ID.

Once you receive your Admob ID, proceed with the below steps for setup.

Open your AndroidManifest.xml file and add a new activity for google AdActivity as shown in the below code.

<activity android:name="" 

It is very important that the android:configChanges should have all the values shown above. If you miss any value, it may result in a error such as "You must have AdActivity declared in AndroidManifest.xml with config changes".

next step is to change your main activity xml where you want to have the ad to be shown. Add the below code as shown.


I am currently using GoogleAdmobSDK of 4.3.1 version and able to run the ads successfully using the build target as Android-13 and with miniSDKVersion as 7.

If you encounter any errors, look at the LogCat to identify the real cause.

I hope this article is helpful to you.

More by this Author

Comments 1 comment

profile image

tatimon 4 years ago

theres another great potion for monetizing new apps, and registration + downloading SDK take sno more than 5 min :)

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.

    Click to Rate This Article