So, my problem that AdMob banner not working in my app, I have done exactly like here: https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start
and when I start my app on my phone there is no banner at all, what I can do to fix this? My publisher id correct, I checked it several times.
Here my code of layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff055500"
android:paddingLeft="50dp"
android:paddingRight="50dp"
android:paddingBottom="5dp"
android:clickable="false"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/name"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="65dp"
android:textColor="#ffffffff"
android:textSize="27sp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btnGetAdviceMain"
android:id="@+id/btnGetAdvice"
style="?android:attr/borderlessButtonStyle"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="55dp"
android:onClick="clickOnGetAdvice"
android:background="@drawable/shape_selector"
android:textColor="#ffffffff"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btnAbout"
style="?android:attr/borderlessButtonStyle"
android:id="@+id/btnAbout"
android:onClick="clickOnAbout"
android:background="@drawable/shape_selector"
android:textColor="#ffffffff"
android:layout_below="@+id/btnGetAdvice"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="5dp" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btnRate"
style="?android:attr/borderlessButtonStyle"
android:id="@+id/btnRate"
android:background="@drawable/shape_selector"
android:textColor="#ffffffff"
android:layout_below="@+id/btnAbout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="5dp"
android:onClick="clickOnRateApp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quote"
android:id="@+id/quote"
android:textColor="#ffffffff"
android:textSize="16sp"
android:layout_marginTop="42dp"
android:layout_below="@+id/btnRate"
android:layout_centerHorizontal="true" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="@string/banner_publisher_id"
ads:adSize="SMART_BANNER"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
Here code in method OnCreate():
AdView adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
Also I have this in Manifest:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>