Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone help me integrating Admob to my game. I've used the badlogic framework by MarioZencher ... and My game is like the SuperJumper. I am unable to use AdMob after a lot of my attempts. I am new to android dev...please help me..I went thru a number of tutorials but not getting adds displayed ...

I did the following...

  1. get the libraries and placed them properly
  2. My main.xml looks like this

    android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" />

  1. My Activity class onCreate method:

    public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

    RelativeLayout layout = new RelativeLayout(this);
    adView = new AdView(this, AdSize.BANNER, "a1518637fe542a2");
    AdRequest request = new AdRequest();
          RelativeLayout.LayoutParams adParams =
                  new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
          layout.addView(adView, adParams);
    glView = new GLSurfaceView(this);
    glGraphics = new GLGraphics(glView);
    fileIO = new AndroidFileIO(getAssets());
    audio = new AndroidAudio(this);
    input = new AndroidInput(this, glView, 1, 1);
    PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
    wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "GLGame");        


  2. My Manifest file looks like this ....

    <activity android:name=""

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-sdk android:minSdkVersion="7" />

When I first decided to use the XML for admob purpose showed no even didn't log the device id in Logcat...

Later when I wrote code in the Main Activity class.. and run ... Application crashed ... with 7 errors evry time ...

The android:configChanges value of the must include screenLayout.

The android:configChanges value of the must include uiMode.

The android:configChanges value of the must include screenSize.

The android:configChanges value of the must include smallestScreenSize.

You must have AdActivity declared in AndroidManifest.xml with configChanges.

You must have INTERNET and ACCESS_NETWORK_STATE permissions in AndroidManifest.xml.

Please help me by telling what wrong is there with the code? Can I write code only in xml files without changing the Activity class ... I will be very grateful to anyone providing support.

share|improve this question
Have you tried making the changes which the error messages indicate are necessary to your manifest file? – BRPocock Feb 1 '14 at 11:59

You need to add the admob activity to your android manifest.. The following question has a good example:

        <activity android:name=""
share|improve this answer
Yes.. it's already added.... – Vishal Kumar May 7 '13 at 4:38
You're missing screenLayout|uiMode, and you also need to add: INTERNET and access NETWORK STATE – wes May 7 '13 at 11:43
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> – wes May 7 '13 at 11:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.