Monday, 28 July 2014

Admob don't show the banner in all the device



I've build this main.xml



<LinearLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:ads="http://ift.tt/GEGVYd"
android:id="@+id/main_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:clipToPadding="true"
android:orientation="vertical" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clipToPadding="true"
android:orientation="vertical"
android:paddingBottom="@dimen/Space075"
android:paddingLeft="@dimen/Space075"
android:paddingRight="@dimen/Space075" >

<!-- start no_account_page -->

<include layout="@layout/no_account_page" />

<!-- end no_account_page -->

<RelativeLayout
android:id="@+id/content_accounts_present"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/Space200"
android:orientation="vertical" >

<ImageView
android:id="@+id/AppLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/big_padlock" />

<TextView
android:id="@+id/SH5Are"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/Space100"
android:layout_toRightOf="@+id/AppLogo"
android:text="@string/SH5Are"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/DarkRed"
android:textSize="@dimen/text075" />

<TextView
android:id="@+id/ProtectingYou"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/SH5Are"
android:layout_below="@+id/SH5Are"
android:layout_marginTop="@dimen/SpaceMinus050"
android:text="@string/ProtectingYou"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/DarkRed"
android:textSize="@dimen/text100" />

<TextView
android:id="@+id/VerificationCodeList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/ProtectingYou"
android:layout_alignParentRight="true"
android:layout_below="@+id/ProtectingYou"
android:paddingBottom="@dimen/Space150"
android:text="@string/VerificationCodeList"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/Black"
android:textSize="@dimen/text075" />
</RelativeLayout>

<ListView
android:id="@+id/user_list"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center|top"
android:orientation="vertical"
android:textColor="@color/Black" />
</LinearLayout>

<include layout="@layout/admob_banner" />

</LinearLayout>


This is the admob_banner.xml



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:ads="http://ift.tt/GEGVYd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="2">

<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
ads:adSize="BANNER"
ads:adUnitId="THIS_IS_MY_ID" />

</LinearLayout>


However happens stange thigs: in some device (I've tried a 3.2" and a 5" device, the first with Android 2.3 and the second with 4.3) the banner is not shown. In my mobile (a 4.5" with Android 4.1) the banner appear but not in the bottom of the page. I'm going crazy. What's my error? Why sometimes appear and sometimes dont? Why does not appear in the bottom of the page? Someone could help me on that? Thanks.


No comments:

Post a Comment