I got a realy annoying Problem with adMob
and his banner
sizes.
The smart banner size is a realy good thing, it does almost anything for you, what has to do with sizing ads, but only almost..
In the google docs is a table which sizes the smartbanner supports. There are many sizes supported but not the landscape from a normal android phone.. https://developers.google.com/mobile-ads-sdk/android-legacy/docs/admob/smart-banners
Thats how it looks like now: Portrait - all good
Landscape - dont work
So is there a way to display my ad in landscape at the right way?
(this is for the ads:adSize="SMART_BANNER"
, when i use ads:adSize="BANNER"
it display on both but its locked to the size that ads:adSize="BANNER"
is giving you, so it look terrible on bigger screens)
XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@color/main_bg_color"
android:id="@+id/rel_bg_home">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1"
android:layout_centerInParent="true"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test"
android:textSize="50sp"
android:id="@+id/uber"
android:shadowColor="#000000"
android:shadowRadius="5"
android:textStyle="bold"
android:textColor="@color/text_color"
android:layout_gravity="center_horizontal"
android:layout_weight="0.20"
android:gravity="center|bottom" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom|center_horizontal"
android:layout_weight="0.30"
android:gravity="bottom">
<Button
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="Play"
android:id="@+id/play"
android:textColor="@color/text_color"
android:layout_marginBottom="20dp" />
<Button
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="Help"
android:id="@+id/help"
android:textColor="@color/text_color"
android:layout_below="@+id/play"
android:layout_marginBottom="20dp" />
<Button
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="Score"
android:textColor="@color/text_color"
android:id="@+id/score" />
</LinearLayout>
</LinearLayout>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_action_achievement"
android:layout_alignParentLeft="true"
android:layout_alignBottom="@+id/toggle"
android:layout_alignTop="@+id/toggle"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:id="@+id/highscore"/>
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/toggle"
android:minHeight="10dp"
android:minWidth="10dp"
android:background="@drawable/check"
android:layout_alignParentRight="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:textOn=""
android:textOff=""
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_above="@+id/adView" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_ad_unit_id1">
</com.google.android.gms.ads.AdView>
</RelativeLayout>