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.
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.