Yuma 4×4

Media and Communications

Mediation Adapters – Mobile Ads Garage #11

Mediation Adapters – Mobile Ads Garage #11


[MUSIC PLAYING] ANDREW BROGDON:
What’s up, everybody? I’m Andrew Brogdon, and welcome
back to the Mobile Ads Garage. Today, we’re going to cover
some new stuff designed to make setting up
AdMob Mediation easier. And we’ll have screencasts
for iOS and Android. This is actually going
to be a short episode since streamlining the mediation
setup process means I have less that I need to show you. Now, we’ve talked
about mediation before. In particular, there’s
an episode from last year that covered what
mediation is and how adapters fit into the process. If you haven’t seen
it yet, I highly recommend clicking on
that preview next to me. Because today, we’re
going to build on that with some new stuff
the team has rolled out to make getting mediation
adapters into your apps simpler. I should mention that this
effort is just getting spun up, so not every network
and format is covered. But for those that
are, it’s pretty great. And the first reason
why is open source. We love open source
here at Google. And we’ve worked with some
of our mediation partners to open the source for the
adapters to their SDKs. And the resulting code
is now hosted at GitHub. There are two repos, one
for iOS and one for Android. They contain the
adapters themselves, along with a sample adapter
project for each platform. And I’m going to have links to
them at the end of this video. So that’s the first cool part. The second is Bintray. So we took that open
source, compiled it, and put the adapters
up on Bintray, which means we’ve been able
to make JCenter packages and CocoaPods for them. So for these adapters,
you no longer have to go hunt down a
JAR file or framework, do a manual download, and
then manually integrate into your project. For these, you can just
add a line to your pod file or build.gradle, do a pod
install or gradle sync, and you’ve got the adapter. All right. So let’s hop into Android
Studio so I can show you how this works for Android apps. All right. So this is just a
simple Android app. And all the action
we’re interested in takes place in this file–
the apps build.gradle. I want to add new
dependencies to this block and get mediation
adapters from JCenter into my project that way. And just to be clear, if I
hop over to the project level build.gradle– there we go– you’ll
see this bit, which defines JCenter as a repository
for the entire project. So it’s automatically used
in the apps build.gradle as a source for those
gradle artifacts. Let’s get the Chartboost
Adapter imported with a compile statement
in the dependencies block. Now this is just for
the adapter itself. So it doesn’t link in
the Chartboost SDK, but you do have a version
number on the end that tells you which version of that
SDK it matches up with. So it’s pretty easy
to stay in sync. There we go. Dual gradle sync. So that’s pretty cool. Let me go ahead and add
a couple more, though. Here’s the adapter for
unity, for example. The Unity Ads SDK. We can just drop that in. There you go. It also has a version
number that matches up with the Unity Ads SDK. And here’s one for mediating
ads from the Facebook Audience Network as well. So you see you have all these
version numbers on them tied to their respective
mediated SDKs, so you never have to worry about
what’s compatible with what. So now that I’m
done, I have adapters for three different
networks in here. But I still need their SDKs. Chartboost distributes
theirs as a JAR file, so I can’t just drop
it in the Libs folder. Unity uses an AAR file, though. And Facebook’s SDK actually has
a gradle artifact of its own, which means I can come in here
and add that line as well. And my application will have
both the FAN SDK and the AdMob Adapter that matches it
and be ready to mediate. There we go. Audience-network. As you can see, those
version numbers line up. There we go. So this is pretty
much the whole deal. Rather than chasing
down individual adapters from a bunch of
different download sites, you can add them straight
to your build.gradle and, in some cases, even import
the mediated SDK that way, too. So it’s much simpler. All right. That’s Android, and
it’s not bad, right? A few clicks and a little
gradle tweaking and you’re pretty much in business. Now, as I mentioned
before, so far this is just with a subset
of our partner networks. But we’re working to
add more all the time. In fact, here’s a live stream
of one of our engineers hard at work right now. [VIDEO PLAYBACK] [CLEARS THROAT] [END PLAYBACK] I love working on a team. OK. Next, I’ll show you
how to use CocoaPods to get one of these adapters
into an iOS project. So for iOS, this is going
to be all about CocoaPods. You can see I’m in
a project directory right now with an
existing pod file. So I’m going to update that
to get some mediation adapters and SDKs into my project. Just open it up in vim. And you can see the line
for the Mobile Ads SDK. I’m just going to go in
right underneath that. And I’m going to add the pod
declaration for our Chartboost Adapter. Google mobile ads
mediation chartboost. And now I’m going to save
that and pop back out to the Command prompt. And I’m going to run pod update,
which is going to spit out a whole mess of stuff. So let’s talk about this. First thing, you can
see that the adapter pod has been installed. That’s right there. And the Chartboost SDK has
been installed as well, with matching versions. Wherever possible, the adapters
pod spec lists the matching SDK as a dependency. So it should be downloaded
for you automatically. And just like that, my project
has the adapter, and the SDK and is ready to mediate. Man, that was fun. Let’s add some more. I can come in here again. And there we go, vim pod file. And I can add both the Unity and
the Facebook Audience Network Adapters as well. Just drop them in right below. There’s Unity and
there’s Facebook. Cool. Let me save that and
do another pod update. And chug away. So if I do a quick
LS, you can see all those pods are in place. And if I pull the
workspace open in Xcode, those pods will
be there as well. Let’s get it up in Xcode. Cool. So that’s how this
works for iOS. All the magic really
happens in that pod file, bringing in
dependencies for you, with much less hassle than going
out and finding them by hand. So that’s iOS. And that’s about it
for this episode. But I do have some
resources for you. First up are links to
the two GitHub repos you saw earlier, the ones
that host our open source adapters for Android and iOS. Next, we’ve got our
mediation networks page, which has instructions
for getting adapters for all the networks
we’re partnered with, whether we have the adapters
up on Bintray yet or not. Next, I’ve got links
to our mediation guides in case you’d like to
learn a little bit more about the details of
implementing mediation in your apps– things like
network-specific values and so forth. And finally, if you’ve
got a technical question about something
you’ve seen here, you’re welcome to bring
it to our support forum. And if you got a question
about this series or an idea for something you’d like us to
cover, leave a comment below. And we’ll see you next time. [MUSIC PLAYING]

4 thoughts on “Mediation Adapters – Mobile Ads Garage #11

Leave comment

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