Admob Banner

64 views
Skip to first unread message

myads...@gmail.com

unread,
Jul 24, 2017, 4:00:08 PM7/24/17
to Google Mobile Ads SDK Developers
Hello,

I want to use banner in 2 parts of my Android app project.
In the fist part the banner is showing without any problem. But in 2nd part the banner doesnt show and when debug it it give me the following line:

Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice("DEVICE ID ") to get test ads on this device.
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 7392
I/Ads: Scheduling ad refresh 60000 milliseconds from now.
I/System.out: [CDS]rx timeout:60000
I/System.out: [CDS]rx timeout:60000
I/System.out: [OkHttp] sendRequest>>
I/System.out: [OkHttp] sendRequest<<
I/Ads: Ad finished loading.

Can't we use 2 admob banner id in 2 places of the same app?

Thanks.

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Jul 24, 2017, 4:44:58 PM7/24/17
to Google Mobile Ads SDK Developers
Hello, 

Thank you for reaching out. Firstly, I don't see an issue loading multiple Banner ads on different screens in your application. You can refer to our Banner ad best practices for more information on this. Also, would you be able to provide us a sample project of your implementation and your Ad Unit ID so we can take a look for you? 

Let me know if you have any other questions.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

myads...@gmail.com

unread,
Jul 24, 2017, 4:59:22 PM7/24/17
to Google Mobile Ads SDK Developers
Hello Thanks for the fast reply,
My .mxl file is here:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingBottom="5dp"
android:background="@color/primary">


<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:textSize="@dimen/text_medium"
android:textColor="@color/white"
android:maxLines="5"
tools:text="Mr.Afghani" />



<LinearLayout
android:id="@+id/player_layout"
android:layout_below="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">

<ImageView
android:id="@+id/play"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="6"
android:src="@mipmap/play" />

<ImageView
android:id="@+id/pause"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="6"
android:src="@mipmap/pause"
android:visibility="gone" />

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:paddingRight="10dp"
android:paddingEnd="10dp">

<SeekBar
android:id="@+id/media_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />

<TextView
android:id="@+id/playback_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|top"
android:textSize="11sp"
android:ellipsize="end"
android:textColor="@color/white"
tools:text="00:00" />
</FrameLayout>

</LinearLayout>


</RelativeLayout>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111">
</com.google.android.gms.ads.AdView>
</LinearLayout>



and my code inside main activity is :



protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
init();
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest request = new AdRequest.Builder().build();
mAdView.loadAd(request);

mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub");
AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
AdRequest adRequest1 = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest1);
}
});


}


Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Jul 25, 2017, 11:16:54 AM7/25/17
to Google Mobile Ads SDK Developers
Hello, 

Thank you for the code sample. It looks like an implementation issue rather than an issue with the SDK. You are trying to implement a Banner ad with an Interstitial ad logic. I suggest that you recheck your implementation and try again. You can also refer to our sample apps for better understanding on this. 

Let me know if you continue to have any issues. I will be happy to help.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

On Monday, July 24, 2017 at 4:00:08 PM UTC-4, myads...@gmail.com wrote:

myads mail

unread,
Jul 25, 2017, 1:53:09 PM7/25/17
to google-adm...@googlegroups.com
private AdView mAdView;


   
protected void onCreate(Bundle savedInstanceState) {
       
super.onCreate(savedInstanceState);

        setContentView
(R.layout.activity_main);

       
MobileAds.initialize(getApplicationContext(),
           
"ca-app-pub-3940256099942544~3347511713");

       
mAdView = (AdView) findViewById(R.id.adView);
       
AdRequest adRequest = new AdRequest.Builder().build();
        mAdView
.loadAd(adRequest);

   
}


   
private InterstitialAd mInterstitialAd;

   
@Override

   
protected void onCreate(Bundle savedInstanceState) {
       
super.onCreate(savedInstanceState);

        setContentView
(R.layout.activity_main);
       
mInterstitialAd = new InterstitialAd(this);
        mInterstitialAd
.setAdUnitId("ca-app-pub-3940256099942544/1033173712");

   
}
}

Thank alot.
i think the idea is the same, I get this sample code from Google Developer website.
The problem is that banner shows in my first screen. Please check the screenshot but not in 2nd screen.


--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/dgHV4G-Ln7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

20399453_10213526539701135_1149887638_o.png

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Jul 25, 2017, 4:01:03 PM7/25/17
to Google Mobile Ads SDK Developers
Hello, 

Thank you for getting back. As mentioned earlier, this is more of an implementation issue rather than an issue with the SDK. I suggest that you go through our documentation and our sample apps for implementation guidelines. I don't see an issue displaying the Banner ads on two different activities/screens. Based on the screenshot, it looks like you're trying to show the second Banner ad on the Popup window. The AdView is instantiated as a Pop up window rather than an activity of the app. It could be the reason of why you're seeing this error. Also, it is possible that there is a delay in the screen refresh. I recommend that you recheck your implementation and try again.

Let me know if you have any other concerns.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

On Monday, July 24, 2017 at 4:00:08 PM UTC-4, myads...@gmail.com wrote:

myads mail

unread,
Jul 25, 2017, 4:33:43 PM7/25/17
to google-adm...@googlegroups.com
Hello again.

Thanks alot.
I have studied all the documents and implementations but i could not show it. I think the implementation in MainActivity is correct (?) and i tried many other ways to call Adview in .xml file but it didnt work. I think the reason is that in the second screen i call banner in pop up window and i dont know how to do it since there is no any material of how its implemented in pop up window.

regards.

--

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Jul 26, 2017, 2:08:19 PM7/26/17
to Google Mobile Ads SDK Developers
Hello, 

Thank you for reaching out. I have investigated the issue with our team. The SDK will allow this implementation, showing a Banner ad on the first screen and another Banner on the Pop up window. However, I would recommend that you be mindful of our policies and our implementation guidelines. Additionally, I suggest that you contact the AdMob Product Support Team for any policy related concerns. As this is implementation specific, it would be best to redirect your concern to other developer forums such as Stack Overflow.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

On Monday, July 24, 2017 at 4:00:08 PM UTC-4, myads...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages