Strange Android AdMob SDK Behavior

I am using the latest version of Android android admob SDK 6.3.1, and the first ad is downloaded and displayed on the device. Then, after the update time is reached, in my case, 30 seconds logcat shows that the ad has been loaded, and the new addition is displayed correctly. However, after the second or less new ad disappears, leaving a place where the add should be empty.

Through a trial version and an error, I found that if I touch the empty space where the announcement should be, it will open the correct link of the 2nd announcement in the browser. Thus, the addition is somehow hidden.

Also, if I touch the lower left corner of the empty second ad, then the second ad is displayed.

I tried this with both relative and linear layouts and on different devices, but the same thing happens. The first ad is displayed correctly, after the update interval, the 2nd and all subsequent ads are loaded and are displayed for a short time before being blank.

As with trying a different layout, I also tried to set the view code in XML and programmatically in the java source.

The fact that I briefly see the second ad confirms that everything is ok on the admob server side, so it makes me think about the layout. But I tried so that every combination could think without success.

Ive tried setting: android: layout_width = "320dp" android: layout_height = "50dp" instead of "wrap_content" or "fill_parent".

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adUnitId="xxxxxxxxxxxxxxxx" ads:adSize="BANNER" ads:loadAdOnCreate="true"/> </LinearLayout> 

This is what I have now that matches the admob official page.

manifest

  <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> 

This is my third day trying to solve this, does anyone have any clues?

+4
source share
3 answers

Do you think this might be device specific. Or a specific API.

0
source

The best answer to this question: -

You can configure the animation to pull the banner down, and when it leaves the view (setting the listener onAnimationComplete), call it:

Code in action: - For visible: -

setVisibility (View.VISIBLE);

For: not Hide

setVisibility (View.INVISIBLE);

therefore, he will no longer occupy a place in the layout.

0
source

I'm sure this can happen if the same ad id name is used in multiple xml operations. android: id = "@ + id / adMob 1"

0
source

All Articles