为免费app嵌入Admob广告
2013-06-13 13:23
363 查看
为免费app嵌入Admob广告,进而获得广告收入。
下载Android平台使用的JAR,查看发布者 ID。
<!– The application’s publisher ID assigned by AdMob –>
<meta-data android:value=”a14ae1ce0357305″ android:name=”ADMOB_PUBLISHER_ID” />
manifest节点添加权限申请
<!– AdMob SDK permissions –>
<uses-permission android:name=”android.permission.INTERNET” />
<?xml version=”1.0″ encoding=”utf-8″?>
<resources>
<declare-styleable name=”com.admob.android.ads.AdView”>
<attr name=”testing” format=”boolean” />
<attr name=”backgroundColor” format=”color” />
<attr name=”textColor” format=”color” />
<attr name=”keywords” format=”string” />
<attr name=”refreshInterval” format=”integer” />
<attr name=”isGoneWithoutAd” format=”boolean” />
</declare-styleable>
</resources>
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:admobsdk=”http://schemas.android.com/apk/res/com.moandroid.livesports”
android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
>
<TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”@string/hello”
/>
<com.admob.android.ads.AdView
android:id=”@+id/ad”
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
admobsdk:backgroundColor=”#000000″
admobsdk:textColor=”#FFFFFF”
admobsdk:keywords=”Android application”
admobsdk:refreshInterval=”60″
/>
</LinearLayout>
1.http://www.admob.com/注册一个帐号,
添加Add Mobile Site/app,输入相关信息后,提交完成,下载Android平台使用的JAR,查看发布者 ID。
2.然后将JAR添加到你的项目中
Properties->Java Build Path->Libraries->Add JARs…->Select the JAR->OK3.编辑AndroidManifest.xml
application节点中添加<!– The application’s publisher ID assigned by AdMob –>
<meta-data android:value=”a14ae1ce0357305″ android:name=”ADMOB_PUBLISHER_ID” />
manifest节点添加权限申请
<!– AdMob SDK permissions –>
<uses-permission android:name=”android.permission.INTERNET” />
4.添加attrs.xml
/res/values/attrs.xml<?xml version=”1.0″ encoding=”utf-8″?>
<resources>
<declare-styleable name=”com.admob.android.ads.AdView”>
<attr name=”testing” format=”boolean” />
<attr name=”backgroundColor” format=”color” />
<attr name=”textColor” format=”color” />
<attr name=”keywords” format=”string” />
<attr name=”refreshInterval” format=”integer” />
<attr name=”isGoneWithoutAd” format=”boolean” />
</declare-styleable>
</resources>
5.添加广告组件
<?xml version=”1.0″ encoding=”utf-8″?><LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:admobsdk=”http://schemas.android.com/apk/res/com.moandroid.livesports”
android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
>
<TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”@string/hello”
/>
<com.admob.android.ads.AdView
android:id=”@+id/ad”
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
admobsdk:backgroundColor=”#000000″
admobsdk:textColor=”#FFFFFF”
admobsdk:keywords=”Android application”
admobsdk:refreshInterval=”60″
/>
</LinearLayout>
6.显示效果
为免费app嵌入Admob广告,进而获得广告收入。相关文章推荐
- 为免费app嵌入Admob广告,进而获得广告收入。
- 为免费app嵌入Admob广告
- 免费Apk盈利之路:嵌入AdMob广告
- 在 App 中加入 AdMob 广告 - 入门介绍与编程技巧
- 【iOS开发】在 App 中加入 AdMob 广告 - 入门介绍与编程技巧
- AdMob:在android应用中嵌入广告的方案
- 每天几分钟,教你免费下载苹果的app,赚Amazon Gift Card 亲测可用【非广告】
- 给app嵌入广告ADBannerView
- 安卓APP无法显示admob谷歌广告,显示Received error HTTP response code: 400
- AdMob:在android应用中嵌入广告的方案
- Unity3d Android程序嵌入Admob广告条
- 使用Admob给Android APP添加广告
- 如何在Android Market赚钱 part 2 - 免费app附带广告
- 百款APP嵌入 KeyMob移动广告聚合平台发布十周
- [l转]在Android中嵌入AdMob广告,赚午饭钱
- 如何在Android Market赚钱 part 2 - 免费app附带广告(转)
- 反编译APP嵌入广告赚钱经验分享
- 你用起来免费的App,都是怎么通过广告赚钱的?
- AdMob:在android应用中嵌入广告的方案
- 如何使用PhoneGap程序将AdMob广告嵌入到你的HTML5 iOS游戏中