Smart banner in Landscape are not full-width

1,366 views
Skip to first unread message

Sylvain

unread,
Mar 25, 2016, 8:04:44 AM3/25/16
to Google Mobile Ads SDK Developers
Hello,

I found an issue with smart banner with htc one m7.

On an application which is landscape only, the smart banner is actually displayed but it's not full width.

It has exactly the width that it would have in portrait.

I mean the smart banner width in landscape is in fact the smart banner width in portrait.
(And aligned to the left).

My app has not xml layout, but mostly native with NDK, with thin java side.
Device is android 5.0.2, all build software are up to date.

Cheers,
Sylvain






Sylvain

unread,
Mar 25, 2016, 8:12:44 AM3/25/16
to Google Mobile Ads SDK Developers
Moreover,
My phone has the setting "auto rotate" setting un-activated (but the app correctly shows up in landscape).

If I activate the "auto-rotate" setting, then rotate the phone in landscape, then start the application.

The smart banner is now almost full-width :
- the height is smaller as expected.
- the width is 93 % of the full-width. but not 100 % !

Cheers,
Sylvain

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 25, 2016, 12:02:41 PM3/25/16
to Google Mobile Ads SDK Developers
Hi Sylvain,

I have just tested this and was able to receive full width SMART_BANNER ads each time on my device. You could use our advanced sample app to see if it is loading for you. The issue could be due to the way you are trying to add AdView on to your Activity. Do test our sample app to see if the issue persists.

Thanks,
Veer Busani
Mobile Ads SDK Team
Message has been deleted

Sylvain

unread,
Mar 26, 2016, 5:10:53 AM3/26/16
to Google Mobile Ads SDK Developers
Hello Veer,

I tested the google advanced sample app using Android Studio, most precisely the "Banner Size App".

1/ By default, the application is in Portrait and the Smart Banner also. All correct. But I cannot move my phone to Landscape.

2/ So I activate the "auto-rotate", the application can now draw in Landscape.
The Smart Banner is as described before. only of with 93%.

3/ I will try to force starting in landscape, without the auto-rotate.
Will do that later because currently the ad fails to load with error code 3 ...

com.google.android.gms.example.apidemo W/Ads: Could not instantiate mediation adapter: com.google.DummyAdapter. com.google.DummyAdapter
com.google.android.gms.example.apidemo W/Ads: Failed to load ad: 3

Cheers,
Sylvain

Sylvain

unread,
Mar 26, 2016, 6:59:23 AM3/26/16
to Google Mobile Ads SDK Developers
Trying to test again forcing the start in landscape, without the auto-rotate, I cannot really prove whether this is bugged or not because this is much different from my app.

I you want to make a test case I can give some element :

- I use AbsoluteLayout in java.
- set the orientation only in java (and not in the AndroidManifest.xml) : setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
- add the AdView and load it, within the onCreate() method.

The AndroidManifest contains, for the main activity :
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode|screenSize|smallestScreenSize"
for the admob activity :
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"

And, in the AndroidManifest :
 android:minSdkVersion="10" android:targetSdkVersion="23"

Cheers,

Sylvain

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 28, 2016, 10:10:18 AM3/28/16
to Google Mobile Ads SDK Developers
Hi Sylvain,

Would you be able to post screenshots of the issue in landscape? There could either be an issue with your device or the implementation or with the SDK itself. It could also be due to lack of inventory for the ads. You could send us your Ad Unit ID(you can do this by replying privately to the author) for us to test to see if we could replicate the issue.

tactical hoceky

unread,
Mar 30, 2016, 7:43:03 AM3/30/16
to google-adm...@googlegroups.com
Hello Veer,

Sorry for the late answer.
Here's 4 screen-shots of 2 distinct apps.
One is only portrait, and the other is only landscape (.. but both are similar app).

The portrait is fine : smart banner is full width (even if the ad inside is smaller).

But the Landscape smart banner is wrong : it is not full width, but it'd rather have the width of the portrait app.

Cheers,

Sylvain









--

---
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/3I8mHGJ1uFw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

landscape__Banner.png
landscape__SmartBanner.png
portrait__Banner.png
portrait__SmartBanner.png

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 30, 2016, 10:58:05 AM3/30/16
to Google Mobile Ads SDK Developers
Hi Sylvian,

Thank you for the screenshots. This confirms to me that a new AdRequest is not made upon orientation change. Would you be able to make a new AdRequest whenever there is an orientation change to see if the issue persists? There are two more things we would need to debug this - 
  • A sample app that would replicate the issue with the BannerView.
  • Charles log for the app. Make sure that you log for both the orientations.
Also try to use this sample app, where I have not used XML to add the Banner AdView. See if you are able to replicate the issue.

tactical hoceky

unread,
Mar 30, 2016, 12:15:33 PM3/30/16
to google-adm...@googlegroups.com
Hello Veer,

Good news :

A)
- Yes, I think this is related to orientation because of the impact of Auto-Rotation Setting. Here's the screen-shot with auto-rotate ON on my htc. (width only 93%)

B)
- Not sure how to "make a new AdRequest whenever there is an orientation change to see if the issue persists" ...

C)
But I have reproduced the issue with the sample app, banner without XML. two modifications :


AndroidManifest.xml,  add in the main activity :

1)

android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode|screenSize|smallestScreenSize"


2) in the MainActivity.java file, add just after "super.onCreate(savedInstanceState);".

"setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);"

(...also : import android.content.pm.ActivityInfo)


I have the app in landscape but the banner with portrait width :/

Cheers,

Sylvain



--
landscape_SmartBanner_WITH_AUTO-ROTATE.png

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 30, 2016, 1:50:54 PM3/30/16
to Google Mobile Ads SDK Developers
Hi Sylvian,

I see the issue and I would like you to suggest a small modification. Instead of calling setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE),make this change in your MainActivity -   android:screenOrientation="landscape". We now have full length Smart Banners in landscape on start.

tactical hoceky

unread,
Mar 30, 2016, 2:57:46 PM3/30/16
to google-adm...@googlegroups.com
Hi Veer,

Yes, this works. The SMART_BANNER is now landscape. (But still only 93% !)

I used to have the orientation in my AndroidManifest.xml, but I changed that a few month ago
because I wanted to port my applications to Android-TV :

I use the same .apk for both Android *phone* and Android-TV.
In java I detect the kind of device, and :
- For phone my app is sometimes Landscape,
- For Android TV my app may be different from Landscape

I can't do *programming*  in the AndroidManifest.xml,
this is the reason why I choose moving the orientation setting to the .java side ...

Maybe, I can always set Landscape in the AndroidManifest.xml, and revert back to Portrait in the .java for Android TV ...
It seems a work around... But At least, I have a solution !


(Also, of course, on Android-TV, I load no AdMob request !)



Veer, another issue also I reported ... would be nice to update it...
https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/60W7Bg-KCkg


Thanks,

Sylvain











Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 30, 2016, 5:20:53 PM3/30/16
to Google Mobile Ads SDK Developers
Hi Sylvian,

Would you mind pinging that thread please? 

tactical hoceky

unread,
Mar 31, 2016, 2:25:07 AM3/31/16
to google-adm...@googlegroups.com
Hello Veer,

Yep. Ping done.

Please let me know about the previous issue :
- is it possible to be fixed ?

- should I use the manifest ? But is it safe to set landscape in the .xml, and switch to portrait in .java in case of Android-TV ?
 
- is the width 93% be fixed ?


Thanks,
Sylvain








--

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 31, 2016, 10:56:47 AM3/31/16
to Google Mobile Ads SDK Developers
Hi Sylvian,

- is it possible to be fixed ?
  • Thank you for pinging the thread. You would get an update through that but as of now, it still has not been fixed.
- should I use the manifest ? But is it safe to set landscape in the .xml, and switch to portrait in .java in case of Android-TV ?
  • There would not be any problem if you have this setting in the manifest. You can always override it when needed.
- is the width 93% be fixed ?
  • No. I need your Charles log for this. Are you seeing this on all of your devices or is it device specific? Would you be able to send us a sample code that replicates the issue here? 
Thanks,

tactical hoceky

unread,
Mar 31, 2016, 11:38:10 AM3/31/16
to google-adm...@googlegroups.com
Hello Veer,

Oops, I meant :
- is the fact of using the "smart_banner with a landscape orientation set from Java" issue going to be fixed ?


I tried with a tablet "Samsung Galaxy Tab S 8.4'' Wifi" :
- the trick of setting the landscape in the xml is not really working :
  a) the smart_ad starts in center portrait size (screenshot LIDL attached), but after the ad refresh, it gets in landscape_size (100%) ..
  b) the ad overlap my game, this is normal since I have not updated the game.
  c) the landscape smart_banner is 100%  (no 93 % issue!)
  d) but the landscape smart_banner ad content seem misplaced (screen shot amazon + screenshot ???)
 

- sorry, but what is a Charles log ?? you mean a "adb log cat" ?
( I would bet the 93% issue is specific to htc since the samsung tab goes to 100%... )

Thanks,
Sylvain


--
Screenshot_2016-03-31-17-21-57.png
Screenshot_2016-03-31-17-26-52.png
Screenshot_2016-03-31-17-29-32.png

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 31, 2016, 3:24:11 PM3/31/16
to Google Mobile Ads SDK Developers
Hi Sylvian,
  1. As of now, I do not have any update on this but I did share this issue with my team and I would inform you as soon as there is any update.
  2. It could be a case where the AdRequest is made before the device orientation is changed to landscape. Could you set a timer to wait and then make an AdRequest?
    • If the issue is device specific, then one of the first usual suspect would be the use of any Custom ROM. I would suggest you to flash your device and test it again just to make sure. 
  3. Charles Proxy is a web debugging tool. Once you install it, do the following - 
    • Go to Help -> SSL Proxying -> Install Charles Root Certificate. 
    • Then Help -> SSL Proxying -> Install Charles Root Certificate on Mobile Device. Follow the instructions here for your device as well.
    • After that go to Proxy -> SSL Proxying Settings and add Host: * and Port: *
    • Finally create a new session and record it while you launch your app.
Thanks,

tactical hoceky

unread,
Mar 31, 2016, 4:21:27 PM3/31/16
to google-adm...@googlegroups.com
Hello Veer,

1) ok, thanks in advance for the future feedback !

2) I am not using a custom ROM (cyanogen or whatever). My HTC m7 and the tablet samsung are *genuine*.
I also have a Samsung S5 : it has also the 93% width. (the AndroidManifest.xml trick works).

3) I have tried but not yet succeed to setup the configruation proxy on the mobile side ...

Cheers,
sylvain



--

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Mar 31, 2016, 4:47:26 PM3/31/16
to Google Mobile Ads SDK Developers
Hi Sylvian,

For me to further debug this, I need a way to be able to reproduce the issue. For this -
  • You need to send us either your APK or the implementation code. 
  • You can also send us your Ad Unit ID.
  • Finally we need the Charles log. Make sure that both your workstation and the mobile are on the same wifi network.
Thanks,

tactical hoceky

unread,
Apr 1, 2016, 2:52:02 AM4/1/16
to google-adm...@googlegroups.com
Hello Veer,

Ad Unit Id is :
          adView.setAdUnitId("ca-app-pub-5246991446818374/7662995247");

The .apk is attached, this is a spider card game.  (https://play.google.com/store/apps/details?id=net.jeu.spider)

The current version is modified so that it displays the smart-banner.
Ad may overlap the game, just because I haven't done the necessary modifications yet.



By the way, the code, I use a transparent background color, otherwise there was an issue with admob a few years ago.. :

          // BUG : Otherwise, the view is not visible first !
          adView.setBackgroundColor(Color.TRANSPARENT);

https://groups.google.com/forum/#!searchin/google-admob-ads-sdk/sylvain/google-admob-ads-sdk/avwVXvBt_sM/U-b8ZWYy35IJ

That was a workaround recommended by Eric Leichtenschlag :

"Hardware acceleration has been a pain on Android. The AdMob WebView turns it off, at least for older versions that don't support it well, which is why you don't have to set the layer type with AdMob.

The lack of refresh on AdMob may just be our test ad unit not having a refresh rate on it. It shouldn't have anything to do with your code. The first ad being invisible is really weird, I've seen it too when using Unity which is probably using some SurfaceView as well. I'd recommend using the transparent color workaround."


Cheers,

Sylvain




--
SDLActivity.apk

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 1, 2016, 12:26:10 PM4/1/16
to Google Mobile Ads SDK Developers
Hi Sylvain,

I was able to reproduce the issue. This looks like it's only happening with devices that have physical menu buttons. I have shared the information with the team and we would let you know as soon as there is any update on this.

Thanks,
Veer Busani
Mobile Ads SDK Team
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.

tactical hoceky

unread,
Apr 1, 2016, 1:54:31 PM4/1/16
to google-adm...@googlegroups.com
Hello Veer,

Ok, good news !
Indeed, good point ! the HTC m7 and also the Samsung S5 have "physical" buttons.

Cheers,
Sylvain

Mobile Ads SDK Team
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
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/3I8mHGJ1uFw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

Sylvain

unread,
May 4, 2016, 3:25:25 AM5/4/16
to Google Mobile Ads SDK Developers
Hello,

Wondering if there are news about the resolution of this issue ?
It would be great to have a public bug-tracker !

Cheers,
Sylvain

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
May 4, 2016, 2:33:08 PM5/4/16
to Google Mobile Ads SDK Developers
Hi Sylvian,

I do not have any update on this. As soon as there is one, I will let you know.

Thanks,
Veer Busani
Mobile Ads SDK Team


xored...@gmail.com

unread,
May 13, 2017, 1:15:30 PM5/13/17
to Google Mobile Ads SDK Developers
Smart Banner ads are not 100% in landscape mode on Galaxy S4 confirmed with two different apps. Its about 93%.

Joshua Lagonera (Mobile Ads SDK Team)

unread,
May 15, 2017, 2:04:26 AM5/15/17
to Google Mobile Ads SDK Developers
Hi there,

We still do not have any updates on this. However, I will follow up on this and get back to this thread if there are any.

Regards,
Joshua Lagonera
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages