How to solve problems with admob does not create ads, but appears as printed?

1

Hello everyone

My problem is this: I currently have a problem with admob that when I try to display an ad, but it is not displayed, what I noticed is that the system sends the request , because it is stored as an impression in the admob application manager panel.

My current code is in the .xml or the layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.virtualdisk.INS" >

      <com.google.android.gms.ads.AdView
      android:id="@+id/adView"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      ads:adSize="BANNER"
      ads:adUnitId="ca-app-pub-1765002374395487/9026293652"
      android:minHeight="90dp" >

  </com.google.android.gms.ads.AdView>

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="124dp"
    android:text="Iniciar" />

<ProgressBar
    android:id="@+id/progressBar1"
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:max="100" />

And in the class it is:

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

And the space that I leave for the announcement is:

If you notice where you fail or know other ways. Please let me know.

    
asked by Abraham.P 21.03.2017 в 00:53
source

1 answer

0

Your code and definition within the layout has no problems, but you are using an emulator, surely you need to define:

.addTestDevice (AdRequest.DEVICE_ID_EMULATOR)

example:

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

DEVICE_ID_EMULATOR The device id for emulators to be   used with addTestDevice (String).

    
answered by 21.03.2017 в 18:48