Showing three ads in TabView

42 views
Skip to first unread message

IndicSIS

unread,
Jun 17, 2014, 1:21:17 AM6/17/14
to google-adm...@googlegroups.com

Hi,

 

I need to show one banner ad per one tabview, so I changes the android:id  (check below code) and the add is successfully appears in all required tabs. Is it ok or its against Google's Terms of Service. Please tell me if any other way to show the ads

 

XML

First Layout

 

<com.google.android.gms.ads.AdView android:id="@+id/adView"
                         
android:layout_width="wrap_content"
                         
android:layout_height="wrap_content"
                         
ads:adUnitId="@string/admobid"
                         
ads:adSize="SMART_BANNER"/>

 

Second

<com.google.android.gms.ads.AdView android:id="@+id/adView2"
                         
android:layout_width="wrap_content"
                         
android:layout_height="wrap_content"
                         
ads:adUnitId="@string/admobid"
                         
ads:adSize="SMART_BANNER"/>

 

Third one

<com.google.android.gms.ads.AdView android:id="@+id/adView3"
                         
android:layout_width="wrap_content"
                         
android:layout_height="wrap_content"
                         
ads:adUnitId="@string/admobid"
                         
ads:adSize="SMART_BANNER"/>

 

Java code:

 

adView = (AdView)this.findViewById(R.id.adView);
     
AdRequest adRequest = new AdRequest.Builder()
     
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
     
.addTestDevice("356d67mydeviceid")

     .build();
     adView
.loadAd(adRequest);
     
     adView2 
= (AdView)this.findViewById(R.id.adView2);
     
AdRequest adRequest2 = new AdRequest.Builder()
     
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
     
.addTestDevice("356d67mydeviceid")

     .build();
     adView2
.loadAd(adRequest2);
 
     adView3 
= (AdView)this.findViewById(R.id.adView3);
     
AdRequest adRequest3 = new AdRequest.Builder()
     
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
     
.addTestDevice("356d67mydeviceid")
     
.build();
     adView3
.loadAd(adRequest3);

 

Output

 

Regards,

IndicSIS

Amy Quispe (AdMob SDK Team)

unread,
Jul 2, 2014, 7:53:16 PM7/2/14
to google-adm...@googlegroups.com
This looks fine to me.

Amy Quispe
Reply all
Reply to author
Forward
0 new messages