How to show google Admob Ad on your Android App

If you want to show ad on your android app, best solution is to use Admob ad. Google admob changed their previous ad showing system from august 2014. Now they control their all services from google play service. Google Admob support only support these languages. If you android app is on other language, do not integret admob in your andorid app.

To setup Admob on your android follow this steps =>
1. Open Android SDK Manager. Select Google Play services – Install Packages.

2. File – import- Browse – Select the project of <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/
Then don’t forget to click on the copy project into the workspace. Click on the Finish.

3. Now right click on your project- Properties- on the left side click Android. Then click on the Add. Select google-play-services_lib – Apply.

 4. Next step is create a Ad Space on the Admob. Go to admob and sign up there. You may have to integrate google adsense account. Try to keep your Admob and adsense account on the same google account. After logging click on the Monetize new app- Add your manualy- Write your android app name – Select the platform android. On the next step add the ad unit name and save it.

You will get a Ad unit Id. something like it ca-app-pub-1505016XXXXXXXXXXXX. Remember it. we need it later.
5. Supppose you want to show your ad on the main layout. Check on this commit. add this bold code on the onCreate function.
protected void onCreate(Bundle savedInstanceState) {
AdView adView = (AdView)this.findViewById(;
AdRequest adRequest = new AdRequest.Builder().build();

6. on the activity_main.xml, add this code carefully. Here i have added ad unit ca-app-pub-1505016XXXXXXXXXXXX. You can see here demo code.

7.  Add this code on your project’s proguard-project.txt file. Source code.
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
-keep public class {
public static final *** NULL;
-keepnames class *
-keepclassmembernames class * { *;
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;

8. add this two codes. One is to get full access of user’s internet connection. Another is to support google play services. Here is the source code. First code you have to input between the manifest tag. Another code you have to input between the Application tag.
<uses-permission android:name=”android.permission.INTERNET”/>
<uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE”/>
Another is
<meta-data android:name=””
android:value=”@integer/google_play_services_version” />

9.  Compile the code and run it on your device. before running don’t forget to on the internet connection. You can see Ad on your android app. Don’t click it. Google does not like spam click. If anyone click on this ad, this ad will open using google play service.

Hope using this process you have sucessfully integrate admob ad on your android app.


  1. If you're looking for a good contextual advertising network, I recommend that you have a look at ExoClick.

  2. We have in the organization for a couple of years and have been accomplishment in creating applications distinctively to overall scope of

  3. Thus, with wide presence and popularity of Android app businesses having an application on Android platform can widen their business reach and eventually find prospective customers.
    more info

  4. This comment has been removed by a blog administrator.

  5. This comment has been removed by a blog administrator.

  6. This comment has been removed by a blog administrator.


Post a Comment

Popular Posts

Install and configure Network simulator (ns3) on Ubuntu 14.04