<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>新しいAdMob 4.0.4を導入 へのコメント</title>
	<atom:link href="https://www.tomiryu.com/android/new_admob_/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tomiryu.com/android/new_admob_/</link>
	<description>tomiryu.com</description>
	<lastBuildDate>Thu, 15 Feb 2018 04:52:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.3</generator>
	<item>
		<title>tomiryu より</title>
		<link>https://www.tomiryu.com/android/new_admob_/#comment-38</link>
		<dc:creator><![CDATA[tomiryu]]></dc:creator>
		<pubDate>Fri, 07 Oct 2011 00:05:07 +0000</pubDate>
		<guid isPermaLink="false">https://www.tomiryu.com/?p=230#comment-38</guid>
		<description><![CDATA[shinriyo 様
はじめまして。

私の場合もランドスケープモードですが、main.xmlにはFrameLayout他は定義しましたが、admob部分に関するレイアウトは記述しない方法で実装しました。

参考までにmain.xmlを抜粋しますが、admob部分については記述しませんでした。
配置するFrameLayoutが関係するのでその部分を抜粋します。
&lt;pre&gt;

&lt;FrameLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;

	xmlns:myapp=&quot;http://schemas.android.com/apk/res/xxx.xxx.xxx&quot;

    android:id=&quot;@+id/mFrame&quot; 
    android:orientation=&quot;horizontal&quot;  
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;fill_parent&quot;
    &gt;

....以下省略（adMobに関する記述はありません。）
&lt;/pre&gt;
としました。

あとは、Main.javaのメインアクティビティのonCreate内で、
　　①mFrameをレイアウトから取得、
　　②adMobのAdViewインスタンスを生成、
　　③生成したAdviewインスタンスをmFrameに配置する、
というコードを実装しています。

Main.javaのonCreate()
[java]
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        setContentView(R.layout.main);
・・・省略・・・
        //// ①mFrameをmain.xmlのレイアウトから取得
        FrameLayout mFrameLayout = (FrameLayout)findViewById(R.id.mFrame);
・・・省略・・・
        //// ②adMobのAdViewインスタンスを生成
        AdView adView = new AdView(this, AdSize.BANNER,&quot;xoxoxoxoxoxoxox&quot;);
        adView.setGravity(Gravity.RIGHT&#124;Gravity.BOTTOM);

        //// ③生成したAdviewインスタンスをmFrameに配置
        mFrameLayout.addView(adView,FP);
        AdRequest request = new AdRequest();
        adView.loadAd(request);
・・・省略・・・
}
[/java]


参考になりますでしょうか。]]></description>
		<content:encoded><![CDATA[<p>shinriyo 様<br />
はじめまして。</p>
<p>私の場合もランドスケープモードですが、main.xmlにはFrameLayout他は定義しましたが、admob部分に関するレイアウトは記述しない方法で実装しました。</p>
<p>参考までにmain.xmlを抜粋しますが、admob部分については記述しませんでした。<br />
配置するFrameLayoutが関係するのでその部分を抜粋します。</p>
<pre>

&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

	xmlns:myapp="http://schemas.android.com/apk/res/xxx.xxx.xxx"

    android:id="@+id/mFrame" 
    android:orientation="horizontal"  
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    &gt;

....以下省略（adMobに関する記述はありません。）
</pre>
<p>としました。</p>
<p>あとは、Main.javaのメインアクティビティのonCreate内で、<br />
　　①mFrameをレイアウトから取得、<br />
　　②adMobのAdViewインスタンスを生成、<br />
　　③生成したAdviewインスタンスをmFrameに配置する、<br />
というコードを実装しています。</p>
<p>Main.javaのonCreate()</p>
<pre class="brush: java; title: ; notranslate">
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        setContentView(R.layout.main);
・・・省略・・・
        //// ①mFrameをmain.xmlのレイアウトから取得
        FrameLayout mFrameLayout = (FrameLayout)findViewById(R.id.mFrame);
・・・省略・・・
        //// ②adMobのAdViewインスタンスを生成
        AdView adView = new AdView(this, AdSize.BANNER,&quot;xoxoxoxoxoxoxox&quot;);
        adView.setGravity(Gravity.RIGHT|Gravity.BOTTOM);

        //// ③生成したAdviewインスタンスをmFrameに配置
        mFrameLayout.addView(adView,FP);
        AdRequest request = new AdRequest();
        adView.loadAd(request);
・・・省略・・・
}
</pre>
<p>参考になりますでしょうか。</p>
]]></content:encoded>
	</item>
	<item>
		<title>shinriyo より</title>
		<link>https://www.tomiryu.com/android/new_admob_/#comment-37</link>
		<dc:creator><![CDATA[shinriyo]]></dc:creator>
		<pubDate>Thu, 06 Oct 2011 17:02:26 +0000</pubDate>
		<guid isPermaLink="false">https://www.tomiryu.com/?p=230#comment-37</guid>
		<description><![CDATA[はじめまして。
ランドスケープモードでうまく表示できませんので参考にしました。
mFrameで使っているmain.xmlの記載はどのように行いましたでしょうか？]]></description>
		<content:encoded><![CDATA[<p>はじめまして。<br />
ランドスケープモードでうまく表示できませんので参考にしました。<br />
mFrameで使っているmain.xmlの記載はどのように行いましたでしょうか？</p>
]]></content:encoded>
	</item>
</channel>
</rss>
