Skip to content

AdMob

애드몹(AdMob)은 2006년에 설립된 미국의 모바일 광고 회사이다. AdMob이라는 이름은 'Advertising on Mobile'의 혼성어이다. 2009년 11월에 구글이 7억 5천만 달러에 인수하였으며, 2010년 5월 27일에 인수가 완료되었다.

Incorporating the SDK

Incorporating Google Mobile Ads into your app is a straightforward process:

  • Add and reference the Google Play services library project in your Eclipse workspace.
  • Add a meta-data tag in AndroidManifest.xml.
<meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version"/>
  • Declare com.google.android.gms.ads.AdActivity in the manifest.
<activity android:name="com.google.android.gms.ads.AdActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
  • Set up network permissions in the manifest.
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Create your banner in XML

Defining a com.google.android.gms.ads.AdView

The easiest way to incorporate an ad is to simply define your AdView as you would any other part of your res/layout/main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:ads="http://schemas.android.com/apk/res-auto"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">
  <com.google.android.gms.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adUnitId="MY_AD_UNIT_ID"
                         ads:adSize="BANNER"/>
</LinearLayout>

As usual you must replace MY_AD_UNIT_ID with your AdMob ad unit ID. Note the inclusion of the ads namespace referenced in specifying adUnitId and adSize.

Look up and Load

To fetch ads, look up the AdView as a resource via findViewById, create an AdRequest, and invoke loadAd:

import com.google.android.gms.ads.*;

public class BannerExample extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // Look up the AdView as a resource and load a request.
    AdView adView = (AdView)this.findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    adView.loadAd(adRequest);
  }
}

Google Mobile Ads SDK FAQ

I keep getting the error 'The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.'
You can safely ignore this message. Your app will still fetch and serve banner ads.

AdMob vs AdSense vs AdManager

AdMob
AdMob은 광고를 통해 수익을 창출하고, 활용 가능한 분석 정보를 얻고, 앱 비즈니스를 성장시키고자 하는 모바일 개발자를 위한 모바일 광고 네트워크 및 수익 창출 플랫폼입니다. 네트워크로 AdMob을 사용하면 전 세계에 광고를 게재하여 모바일 앱에서 수익을 창출할 수 있습니다. 여러 광고 네트워크를 사용하는 개발자를 위한 수익 창출 플랫폼으로 AdMob을 사용하면 모든 타사 네트워크 파트너의 광고 수익을 극대화할 수 있습니다.
AdSense
애드센스는 광고 네트워크 역할을 하며, 광고주 수요를 찾고 광고 인벤토리를 설정할 수 있게 도와줍니다. 애드센스는 광고 솔루션을 더욱 자동화하고, 소규모 전담 광고 관리팀을 보유하고 싶어 하는 게시자에게 가장 적합합니다.
Ad Manager
Google Ad Manager는 상당한 규모의 직접 판매를 진행하는 대규모 게시자를 위한 광고 관리 플랫폼입니다. Ad Manager에서는 상세한 관리 기능을 제공하고 애드센스, Ad Exchange, 타사 네트워크 및 타사 광고 거래소를 비롯한 여러 광고 거래소와 네트워크를 지원합니다.

See also

Favorite site

Beginning AdMob banner

in Android

References


  1. Android_insert_admob_advertisement.pdf