| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
182 バイト追加 、 2020年2月15日 (土) 08:00
編集の要約なし
==Android AdMob==
[[Android][Eclipse][Java]]
http://jp.admob.com/
===アカウントロックについて===
<&lt;blockquote>&gt;突然アカウントがロックされることがあるので【注意】<&lt;/blockquote>&gt;
*先日、警告もなく、いきなりアカウントをロックされた。
====AndroidManifest.xml に、以下のようにパブリッシャーIDを記述====
<&lt;meta-data android:value="a14xxxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID"/>&gt; <&lt;/application>&gt;
===ステップ3===
*以下の記述を追加
*既にある場合、declare-styleable 要素を追記
<&lt;?xml version="1.0" encoding="utf-8"?> &gt; <&lt;resources>&gt; <&lt;declare-styleable name="com.admob.android.ads.AdView"> &gt; <&lt;attr name="backgroundColor" format="color" /> &gt; <&lt;attr name="primaryTextColor" format="color" /> &gt; <&lt;attr name="secondaryTextColor" format="color" /> &gt; <&lt;attr name="keywords" format="string" /> &gt; <&lt;attr name="refreshInterval" format="integer" /> &gt; <&lt;/declare-styleable>&gt; <&lt;/resources> &gt;
===ステップ5===
xmlns:myapp="http://schemas.android.com/apk/res/com.example.SampleApp"
=====一つの広告を含むシンプルなスクリーンは、以下の様になる=====
<&lt;?xml version="1.0" encoding="utf-8"?> &gt; <&lt;LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.example.SampleApp"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"> &gt;
<&lt;com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
/> &gt;
<&lt;/LinearLayout> &gt;
===ステップ5.5===
====SDKのバージョンアップによりAndroidManifest.xmlに、以下のような記述をしなければならなくなったようだ(詳しい確認は後日行う)====
<&lt;!-- AdMob Activity -->&gt; <&lt;activity android:name="com.admob.android.ads.AdMobActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboard|keyboardHidden"
/>&gt; <&lt;!-- Track Market installs from AdMob ads --> &gt; <&lt;receiver android:name="com.admob.android.ads.analytics.InstallReceiver" android:exported="true">&gt; <&lt;intent-filter>&gt; <&lt;action android:name="com.android.vending.INSTALL_REFERRER" />&gt; <&lt;/intent-filter>&gt; <&lt;/receiver>&gt; <&lt;!-- The application's publisher ID assigned by AdMob -->&gt; <&lt;meta-data android:value="a1496ced2842262" android:name="ADMOB_PUBLISHER_ID"/>&gt; <&lt;!-- use a separate publisher id here to aid in tracking intersitial statistics -->&gt; <&lt;meta-data android:value="a1496ced2842262" android:name="ADMOB_INTERSTITIAL_PUBLISHER_ID" />&gt;
===ステップ6===
====テストモードの利用====

案内メニュー