(AdMob's Home Page)

Setting up an AdMob account

In order to use AdMob you need to have an AdMob account.
If you don't have one yet you should go to the AdMob website and sign up with your Google account.
When you sign up you will be asked to complete some information regarding AdSense, AdWords and to accept the AdMob program policies.

Google AdMob Homepage

Once you've filled out all the necessary information and accepted the policy you're ready to start using AdMob.
If you don't have a Google account you need to create one first.

Back to Top

The Google Play Services SDK

The Google Mobile Ads API's are part of the Google Play services platform and in order to run ads in our app we need to have the Google Play Services SDK installed and added to our project.

icon sdk manager

To install the Google Play Service SDK open up your SDK Manager. If you are using Eclipse you can find the SDK Manager's icon on the left side of your toolbar (see picture). Android Studio uses the same icon also located on the toolbar.

sdk manager

Once you've opened up the SDK Manager scroll down to extra's. Select Google Play Services plus Google Repository!
Your SDK manager might also have other boxes checked boxes for packages you haven't installed yet and/or for updates. You can uncheck them for now to speed up the installation process. If you have a bunch of packages selected and you are going to install all of them keep in mind that it could take quite a long time before all packages will be installed.
Once you press Install Packages the SDK manager will ask you to accept the License agreement and install the packages for you.

import android code

After you've installed the Google Play Services SDK right you need to import the SDK into your workspace.
In Eclipse you can do this by either clicking on File -> Import or right-clicking on your package explorer and select import and select Existing Android Code into Workspace. This will bring you to the Import Projects window, where you have to specify which android project you want to import. Click on Browse and navigate to your android sdk folder.

if you don't know where your Android SDK is located open up your SDK Manager.
You're SDK's location is shown at the top of the window.

Now open up your sdk folder and in the extras folder you'll find a google folder. Open it up and select the google_play_services folder. You only need to install the google_play_services_lib project and not the sample projects. When you press finish Eclipse will automatically add the google-play_servies library to your package explorer.

Last thing you need to do is to append/add the Library to your Android project: You can do this by right clicking on your android project and select Properties -> Android. Make sure google-play-services_lib is selected under Library and click on Add.

At this point you have set up all the necessary basics to start adding code necessary to display AdMob ads. We'll go into this in Part 2 of the tutorial series.