안드로이드 어플리케이션에 애드몹(admob)달기
1.admob-sdk-android 디렉토리에 admob-sdk-android.jar파일을
libs폴더를 생성하여 넣어줍니다.

2.프로젝트에서 Properties로 갑니다.

3.JAVA Build Path를 선택합니다.

4.Add JARs를 클립합니다.

5.libs폴더에 있는 admob-sdk-android.jar 선택해주고 Ok버튼을 클립 합니다.
6.publisher ID 를 AndroidManifest.xml 코드에 적어줍니다.
</activity>
<meta-data android:value="a149xxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" /> </application>
<meta-data android:value="a149xxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" /> </application>
publisher ID는 AdMob에 로그인 합니다. Manage Settings를 클릭하면
상단에 publisher ID를 찾을수 있습니다.

7. </manifest> 전에 INTERNET permission을 AndroidManifest.xml 추가합니다.
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="backgroundColor" format="color" />
<attr name="primaryTextColor" format="color" />
<attr name="secondaryTextColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
</declare-styleable>
</resources>
9.패키지 이름을 xml 라인에 추가합니다. my.test 가 패키지 네임이면
xmlns : MyApp는 = " http://schemas.android.com/apk/res/my.test "
그래서 하나의 광고와 함께 간단한 화면 구성은 다음과 같이 합니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/my.test"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
/>
</LinearLayout>
10. 완료된 광고를 한번 봅시다^^

설명이 부족한 점이 있다면 수정하겠습니다. 감사합니다^^
광고 클릭했을때 돈 올라 가네요 신기합니다 ㅋ
http://www.cyworld.com/kkjw1801/3380072
댓글
댓글 쓰기