Designs How-To Tutorials

A Definitive Tutorial to Incorporate An In-app Ad via AdMob

AdMob is the abbreviation of “Advertisement On Mobile”. As most of the users often prefer the free mobile applications over the paid applications, the developers have streamlined the two alternative routes for app monetization including in-app purchases and in-app advertisements. If you are looking for the ways to efficiently monetize your app by integrating an advertisement in it, this AdMob tutorial 2015 will offer you a complete guide to breakthrough the process in an absolute way.

There are several advertising networks that are grabbing the popularity across the globe. While delivering top-notch solutions for in-app advertisements, they help developers associated with Android applications development platform to generate greater revenue. For instance, the Google AdMob that is the much sought after choice for the majority of developers.

It augments app monetization via an amazing app-vertising model. The featured Software Development Kit (SDK) facilitates the connection across the eminent mobile platforms including, Android, Windows phone and iOS. Its SDK also offers a list of ad formats to choose from like the ad banner as interactive ads, standard banner ad, custom search ad and so forth.

Let’s begin with this AdMob tutorial 2015 and explain the steps needed to be processed for integrating an ad in your mobile application.

Step 1: First Things First – Create an account

While getting started, the very first thing that you will need to do is configure your account with the AdMob. However, if you already possess an account with AdMob, simply sign into that account and proceed further.

Once you are done with that, you will see your publisher id on the top-right corner of the dashboard.

AdMob tutorial 2015 Step 1

Step 2: Develop an ad unit

Now, navigate to the Monetize tab and generate an advertisement unit while considering your app design. Here, you can see a window as shown in the below image.

AdMob tutorial 2015 Step 2

Step 3: Create a new Eclipse project

First, get the Google Play Services Library downloaded in your Eclipse IDE.

  • Now, access the File tab and under the New tab select the Android Application Project.
  • After doing so, you will get a small form, simply add the project details in the corresponding fields.

Here, let’s assume the project name to be AdmobBannerExample.

  • Application Name : AdmobBannerExample
  • Project Name : AdmobBannerExample
  • Package Name :
  • Finally import the Google Play Services Library into your mobile application.

AdMob tutorial 2015 Step 3

Step 4: Update the class

  • Access the class of your application project.
  • Copy and paste the below mentioned piece of tutorial code into it.

Code Snippet for the class

Step 5: Create XML graphical layout

For generating an XML graphical layout for the MainActivity class, just navigate to the res, right click on the Layout tab, and create a new Android XML File.

Save this file as activity_my.xml. Now, open this file and add the below mentioned piece of code into it.

Code Snippet for activity_my.xml

Code Snippet for fragment_my.xml file

Code Snippet for the fragment_ad.xml file

To ensure the Internet access, it is essential to add the “uses-permission” in the “AndroidManifest.xml” file. The below mentioned chunk of code will facilitate access to the Google Play services meta-data and AdActivity.

Code Snippet for the AndroidManifest.xml

On executing the process mentioned in this article, you will get the output as showcased in the following image.


AdMob tutorial 2015 Output

By following this AdMob tutorial 2015 steps thoroughly and deploying the aforementioned code properly, you can easily integrate an advertisement in your application. This way you can efficiently maximize your return on revenue and boost your business value.

About the author


Naaz is a web designer and loves to find new tips and tricks for creativity purposes and likes to share them with the people.

1 Comment

Leave a Comment