AdMob - Crashing

Kamac

Active Member
Licensed User
Longtime User
I've met problems with AdMob.

i am pretty sure it is causing my app crash on start.

Here's some code:

B4X:
Sub Globals
    Dim AdView1 As AdView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("main")      
   'label1.Text = mResult    mResult as barcode result
   AdView1.Initialize("Ad", "my_id") 'publisher id that you received from AdMob.
   Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip)
   AdView1.LoadAd 'loads an ad
   AdView1.Visible = True
End Sub
 

Kamac

Active Member
Licensed User
Longtime User
I found the error.

It wasn't AdMob but:

B4X:
   If File.Exists(File.DirDefaultExternal, "Barcodes.txt") == False Then
      File.WriteList(File.DirDefaultExternal, "Barcodes.txt", List1)
   End If
   If File.Exists(File.DirDefaultExternal, "Monsters.txt") == False Then
      File.WriteList(File.DirDefaultExternal, "Monsters.txt", Monsters)
   End If

these lines.... There's nothing wrong in them throught...
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Error fixed?

I found the error.

It wasn't AdMob but:

B4X:
   If File.Exists(File.DirDefaultExternal, "Barcodes.txt") == False Then
      File.WriteList(File.DirDefaultExternal, "Barcodes.txt", List1)
   End If
   If File.Exists(File.DirDefaultExternal, "Monsters.txt") == False Then
      File.WriteList(File.DirDefaultExternal, "Monsters.txt", Monsters)
   End If

these lines.... There's nothing wrong in them throught...

I saw you have == like in c. Only one = is needed.

Margret
 
Upvote 0
Top