Android Question new admob integration

merlin2049er

Well-Known Member
Licensed User
Longtime User
Hi, I signed up for an admob account. Got an ap-id after creating a top banner.

I then proceeded to update android sdk, and eclipse plugin. Then downloaded the admob 1.40 library, and downloaded the GoogleAdMobAdsSdk-6.4.1.jar (renamed this to GoogleAdMobAdsSdk.jar) and copied them both to basic4android/Additional libraries...

I used NJdude's code (thanks!)

Code: Copy
 Adbox.Initialize2("Ad", "xxxxx", Adbox.SIZE_BANNER)
    Activity.AddView(Adbox, 0dip, Activity.Height - 50dip, Adbox.Width, Adbox.Height)
    Adbox.LoadAd
         
    ToastMessageShow("Width=" & Adbox.Width, True)
    ToastMessageShow("Height=" & Adbox.Height, True)

substituted "xxxx" with my ap-id.

It compiles alright, but I get stuck on as it starts up.

Code: Copy
 Activity.AddView(Adbox, 0dip, Activity.Height - 50dip, Adbox.Width, Adbox.Height)


I get a java.lang.NullPointerException.
 
Do you have these lines in the Manifest?
Code: Copy
AddApplicationText(<!-- *** For AdMob: manually added *** -->)
AddApplicationText(<activity android:name="com.google.ads.AdActivity")
AddApplicationText(android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|smallestScreenSize|screenSize"/>)

However, not having these lines should display a different error message.
 
Upvote 0
Ok, just added that to the manifest, but it didn't help.

Just noticed under my global area troubleshooting section...

Adbox (adview) Layout not available.

Do I have to create another layout in the designer? (for the add)
 
Upvote 0
Back
Top