Yuma 4×4

Media and Communications

Importing the Mobile Ads SDK – Mobile Ads Garage #1

Importing the Mobile Ads SDK – Mobile Ads Garage #1

everybody, and welcome to the first episode of
the “Mobile Ads Garage,” where we cover the nuts and
bolts of mobile ads code in a format that’s just like
my grandma– short and sweet. I’m Andrew Brogdon,
a developer programs engineer with the Google
Mobile Ads SDK team. We’ve heard from a
lot of our publishers that you’d love more
technical content. So we’re here to get our hands
dirty, to wire things up, turn them on, and see how they work. We’ll have screencasts
of real code, hack on real applications,
and, with the help of my intrepid partner,
Gary the graphics guy, we’ll show you the results. So if you’ve ever taken a look
at the AdMob documentation and thought, that’s
great, but could you have a ginger explain
it to me in a format I can watch on my phone,
turns out we can do that. For our first
episode, we’re going to focus on how easy it is
to get started with the SDK. Let’s imagine that I’m in
an application– exactly. One of the simplest
ways to monetize an app is just by adding a banner. But there’s also
interstitial ads like these, or even native ads like these. The one thing all these
formats have in common is the Mobile Ads SDK. Properly importing and
referencing it in your project is step one. So let’s take a look
at how to do it. We’ll start with iOS. So here we are in Xcode with
a very simple Hello World app that I’d like to
import the SDK into. So how do I do it? Well, here are the steps. I’ll be using CocoaPods today. So the first step is to
create or update the PodFile. Then I’ll run pod install,
which will download the SDK and integrate it
into the project. And then I’ll open the workspace
file that CocoaPods creates. And I’ll be right back
in Xcode ready to go. So here I am in the root
directory of my Xcode project. And I’m going to open the
PodFile in a text editor. And I’m going to
drop in some text. If you’re familiar
with CocoaPods, this should look
really familiar to you. The important part is
this line right here. That tells CocoaPods
that the project has a dependency on version
7.0 or higher of the Mobile Ads SDK. So I’ll save this. And then I’ll run
pod install, which will download the SDK
automatically and integrate it into my project. And as you can see, we’ve got
a lot more stuff in this folder now. So I’m going to open
up that workspace file. And now I’m right back in Xcode. And just like any
other framework, I can use an import
statement to reference it in one of my files. And now that I
have GADBannerView, which is an AdMob class,
it’s properly recognized. So you know the SDK is in here. We try to make it as easy
as possible to integrate mobile ads. Time is money, and we’re all
about keeping costs down. For example, the garage
behind me– that’s not even a real garage. This is, like, a
holodeck situation. Watch, I could be
in outer space. Or I could be swimming
with the dolphins. I could even be backstage
with Justin Bieber if I wanted to be. Gary, get it– oh. Legal didn’t approve
the– so I shouldn’t even do the Bieber joke at all? Well, legal fees aside, we
try to keep costs down so we can keep your revenue up. Let’s take a look at importing
the SDK into an Android Studio project. OK, so here I am in Android
Studio with a Hello World app that I’d like to
get the SDK into. So what are the steps? For Android, there is just two. First, I’ll update the
app’s build.gradle file to add a dependency
on Mobile Ads. Then I’ll do a Gradle
sync, and I’m ready to go. OK, here’s my build.gradle. And I’m going to go to
the dependency section and add a line. That’s right down here. The Google Mobile Ads SDK is
part of Google Play services. So what we’re doing is telling
Gradle to pull in just the ads code with play-services-ads. And the numbers at the
end are the version. You should always try
to use the latest one. Now that that’s done, I’m
going to do a Gradle sync. That’s where Gradle pulls in all
the resources my project needs, checks all the references, and
makes sure everything’s OK. If this is the first time you’ve
used Google Play services, Android Studio might
pop up a window and ask you to download
something called the Google Repository. If that happens, don’t worry. That’s just Android
Studio and Gradle downloading the SDK for you. OK, now that we’ve
finished the Gradle sync, let me come back to
my activity and try to use one of the SDK’s classes. Here we go. You can see it
automatically suggesting the package and class,
so the SDK is definitely in the project now. So that’s it. Getting the SDK into a
project is the first step toward displaying ads
and earning revenue. In our next video,
we’ll cover how to use the SDK to
display banners on both iOS and Android. In the meantime, I’ve got
some great resources for you, like our AdMob Quick
Starts for iOS and Android, which have notes for Java,
Objective C, and Swift. We also have sample
code up on GitHub for both operating
systems, so check those out if you’re interested. You might also like AdMob’s
mobs no nonsense guide to app monetization. It’s an overview of
monetization strategies that includes code and
tips from other engineers. If you’ve got a technical
question relating to anything you’ve just seen,
stop by our support forum. And if you’ve got a question
about this video series or a tip on something
you’d like us to cover, leave a comment below, and Gary
and I will see you next time. [MUSIC PLAYING]

54 thoughts on “Importing the Mobile Ads SDK – Mobile Ads Garage #1

  1. This is awesome, really amazed how much support Google has for us, Thank you! Only comment I have is could you also post the in video links in the description? My YouTube app on iOS doesn't support in video links.

  2. Your Videos are awesome. please make a video about admob mediation. how to integrate and how it works…..its really important to consider unity integration also …thank u.

  3. Hello can you tell me the difference between AdMob and Google Adwords. I want to integrate Adwords in my IOS app. I don't have any idea about… can you explain me briefly. Then I want to know about, once if I create conversions and get an ID, VALUE, and Label, How to implement in my code, can you please explain briefly and show me full demo and Sample to run in my MAC, Thank You advance

  4. DON'T USE AdMob! After years of quite good numbers this happened few weeks ago: banner's match rate at 40%, fullscreen at 80%, ridiculous RPM and NO SUPPORT AT ALL!!!

  5. Hi, When Ever i Add The >> AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    << i Get That The adView in "R.id.adView" Cannot be Resolved :/ Even if i add The latest version of Google-services-ads in The Gradle app 🙂

  6. Can anyOne Tell me the difference between these 2 Unity Ad APIs (Both APIs are for Unity but what is the difference?)

    1) https://github.com/googleads/googleads-mobile-unity/releases (Find in another Video)
    2) https://github.com/unity-plugins/Unity-Admob (Given In this Video)

  7. Great idea to put these tutorials together however, if you want to integrate Admob and others in a matter of minutes and without coding, please take a look at how Enhance can help you! http://fgl.io/ip4

  8. Hello , please i put a native ads express in my static page android app , but i have a problem when my samsung keyboard is shown to put a number the native ads crashing . what is the solution please ?

  9. Can you please show how to install the framework manually, rather than CocoaPods? Also, can you show us more Swift examples? It's been out since 2014……

  10. I ve uploaded around 100 plus apps with Admob ad ids and the app integrated sdk versions were 7.0.0 plus,but i ask one question,when will you release the next mail about the sdk update notice?because i dont keep all of my apps code folders and i did not backup the files at all.i had only the apks and if i must change the app sdk in future i may affect so much and my business will be going down.

  11. Can I use implementation 'com.google.android.gms:play-services-ads:11.8.0' instead of compile 'com.google.android.gms:play-services-ads:11.8.0'. After using implementation i am getting less impression. is it the reason?

  12. Hello Good day, please I need a serious help, i cant integrate AdMob into my android studio project, am getting errors saying "all com.android.support libraries must use the exact same version specification"
    It underline 'com.android.support:appcompat-v7:26.0.0-beta1' and 'com.google.android.gmslay-services-ads:17.0.0'

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:0.5'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
    implementation 'com.google.android.gmslay-services-ads:17.0.0'

  13. This error exists

    All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:customtabs:26.1.0 less… (Ctrl+F1)
    There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion). Issue id: GradleCompatible

  14. for the admob masters here I want to ask for help.

    During this time I faced a problem about verification that I failed, here I have entered the PIN. But why am I still receiving messages on the adsen homepage like below?

    Your ad unit doesn't display ads because your identity failed to verify. Contact us to verify your identity and continue ad serving.

Leave comment

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