Admob Help

paris7162

Member
Licensed User
Longtime User
I looked over the admob tutorial post continuously and can't figure it out. I am currently using Mobfox but would like to use admob.

What am I doing wrong? I create simple code just to see the adds. I actually created the publisher id about a month ago and gave up on it.(I masked the publisher Id, but it is a valid publisher Id.

Here is my manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: Manifest Editor
AddManifestText(
<uses-sdk android:minSdkVersion="4" />
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
'AdMob
AddApplicationText(
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
)
'End of AdMob


Here is my code:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim pnl As Panel
Dim AdView1 As AdView
End Sub

Sub Activity_Create(FirstTime As Boolean)

pnl.Initialize("pnl")
Activity.AddView(pnl,0dip,0dip,320dip,50dip)
pnl.Color = Colors.Blue
pnl.Invalidate

' Activity.LoadLayout("1")
AdView1.Initialize("Ad", "xxxxxxxxxxxxx") 'publisher id that you received from AdMob.
Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip) '<b>previously the height was 48dip. Now it is 50dip.
AdView1.LoadAd 'loads an ad


End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub Ad_FailedToReceiveAd (ErrorCode As String)
Log("failed: " & ErrorCode)
End Sub
Sub Ad_ReceiveAd
Log("received")
End Sub
Sub Ad_AdScreenDismissed
Log("screen dismissed")
End Sub

I received the following error every time:
failed: a network error occurred.

Mobfox works perfectly so I don't understand what's going on.
 

paris7162

Member
Licensed User
Longtime User
Also, I added the admob library and it is checked. And I downloaded the Googleadmobadssdk and unzipped it.
 
Upvote 0

worm

Member
Licensed User
Longtime User
Are you loading your app in the emulator or on your device?
Some emulator have problem with network, also some devices (My Toshiba AC-100 has problems with ADMob..)
 
Upvote 0

paris7162

Member
Licensed User
Longtime User
I don't use the emulator much if at all. I am running the code on a rooted HTC Thunderbolt and a rooted Kindle Fire running the Energy ROM.

How would I check for firewalls?
 
Upvote 0

paris7162

Member
Licensed User
Longtime User
At work on an XP machine (I use windows 7 at home - I'm really wishing for an OSX version real soon -fingers crossed), I updated the API to 13 and Admob worked perfectly on the emulator(no wifi at work). At home I'm using API 15. When I get home from work try API 13 and let you know if it works or not.
 
Upvote 0

robife

Member
Licensed User
Longtime User
I have same problem I get following error

A referenced library is missing: googleadmobadssdk
--------------------------------------



I just found it .

I renamed
GoogleAdMobAdsSdk in lib folder and it works.
 
Last edited:
Upvote 0
Top