Your First Android App with AdMob

If you start to develop your first android application in Android Studio or in any other programming tool, you would like to have some benefit from it. The best way to achieve this is to add Google AdMob into your application. You must already have open account in Google AdMob. If you have your account opened, go there and copy your Google AdMob code, by clicking on link “Monetize”, choose your application and copy your code as it is shown in figure bellow. You will use this code later on in the application.

Where-is-your-AdMob-code

So when you start to develop your first android app with AdMob, just start new project in Android Studio.

New-Project-in-Android-Studio

Then choose SDK (APK 15 is recommended)

Choosing-SDK

Next important step is to add Google AdMob Ads Activity to your application. Then your application will have Google AdMob by default.

Add-an-activity-to-Mobile

Recommended activity is banner activity, since it is less invasive.

Banner-activity

When project is started, be sure to know how to switch to design view (app→res→layout→activity_main.xml), and click to design tab.

Android-APP-DesignView
Then go to app→res→values→strings.xml and paste your Google AdMob there

Place-to-paste-AdMob-code
Now you can change message from “Test ads are being shown. To show live ads, replace the ad unit … ” to something else, let’s say “Welcome”. So go to app→java→cirvirlab.gcd→MainActivity.java and make necessary changes there.

Change-message-to-Welcome

Now you have your first android app with AdMob, with zero functionality but with Google AdMob there.

External links:

Get Started in Android Studio on developers.google.com
Adding AdMob into an Exiting Application on developers.google.com
AdMob Android on Coderefer

Posted in android

Leave a Reply

Your email address will not be published. Required fields are marked *

*