#Region Project Attributes
#ApplicationLabel: InApp Example
#VersionCode: 1
#VersionName: 1.0
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
'#AdditionalRes: C:\Android SDK\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: false
#End Region
Sub Process_Globals
Dim adtimer As Timer
Dim manager As BillingManager3
Private inappkey As String = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiIEJEB/JNzDSn8YoWUE/dq7/q8HDUjUL5np0tSmk3pdauYO2rRMvDNxXO4e+FqgYhYjswBKdFeIlzLVF8+y2J49G85eaznP8ZYbt0vexH6lpk0iJxrfOxeGo8BY3IvUaCm0PXwdM9gos+XwZo14lr+pFSfpR/qd7PzXBqtdZ9NxvAyAnlLGrpzHuTApRCp8EIMc1kYZHd/pGtTcRyLuCGxFW0cbsrpKUIMHzDe1S/pp7bRqs3tMjagySWx0Kzic0ufxxa6v/XzbBDQPeSpyIcZLFxNuDBrZElu83cC39JZz1kKiGSfcMmsz/eegJo/AdII8CVkJjY5ov6CG64i+cPQIDAQAB"
End Sub
Sub Globals
Dim b As Button
Dim mwAdInterstitial As mwAdmobInterstitial 'interstitial ad (admob)
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.Color = Colors.White
adtimer.Initialize("adtimer",25000) '25sec to show ad
b.Initialize("Button")
b.Text = "No Ads"
b.Color = Colors.DarkGray
b.TextColor = Colors.White
Activity.AddView(b,20dip,20dip,150dip,50dip)
mwAdInterstitial.Initialize("mwadi","ca-app-pub-8081096265852200/8781593570") '<---- ERROR HERE
mwAdInterstitial.LoadAd
If FirstTime Then
manager.Initialize("manager", inappkey)
manager.DebugLogging = True
Else
If File.Exists(File.DirInternal,"ad.txt") = False Then 'manager will be called only on firsttime true, if firstime is false we will check if ad.txt exists what means that the app was purchased. now we should hide the "buy me" button and disable ads until we will be able to check again if the "no_ads" item was purchased!
'hide purchase button
'disable ads
End If
End If
If File.Exists(File.DirInternal,"ad.txt") Then adtimer.Enabled = False 'change default ad support to off
End Sub