4

I am having problems with getting a standard banner adView to "play nice" with my GLSurfaceView.

When the adView changes states (switches between its 3 appearances), it causes a noticeable drop in frame rate in the GLSurfaceView.

Here is the code from my xml layout (XXXXXX = censored info :) ):

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffffff"
tools:context=".MainActivity" >

<com.google.ads.AdView
    android:id="@+id/adViewX"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    ads:adSize="BANNER"
    ads:adUnitId="XXXXXXXXXXXXXXXX"
    ads:loadAdOnCreate="true"
    ads:testDevices="TEST_EMULATOR, XXXXXXXXXXXX" />

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginTop="50dp"
    android:background="#ffffffff" >

    <XXXXXXXXXXXXXXXXXXXXX.FunSurface
        android:id="@+id/funSurface"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true" />

</RelativeLayout>

Aside from setContentView(xml layout file); nothing is done programmatically.

If I remove the adview from the layout, my GLSurfaceView (FunSurface) is silky smooth.

Anyone have any ideas to remedy this problem?

NOTE: The GLSurfaceView uses OpenGL ES 1.1

Werner
  • 769
  • 2
  • 6
  • 19

0 Answers0