Tutorial: Add admob interstitial ads to your CoronaCards Windows Phone 8 app

To answer myself, to call the C# you need something like this:

local function adInterstitialShow()

    local result = Runtime:dispatchEvent({ name = “Native_ShowInterstitialAd” });

end

How to use your code with Visual Basic? All wp8 files created by project have Visual Basic’s .vb extension not C#'s .cs, for e.g. MainPage.xaml.vb. Help please :slight_smile:

@hrvoje.ljubich

The code I have provided is C# code not Visual Basic. I’m pretty sure CoronaCards only works with C# as well since their project template is in C#.

Why do you want to use Visual Basic?

We actually do provide a VB.NET WP8 CoronaCards project template.  :slight_smile:

When providing .NET project templates, it’s considered good practice to provide templates for both C# and VB.NET since those are the most popular.NET languages.  Although, in my opinion, C# is the dominant .NET language and it’s in your best interest to learn it

You’ll need to convert and integrate @spacewolf’s C# code to your VB.NET project yourself.  It’s not difficult.  Other than syntax, the features supported by the 2 languages are very similar.  The only striking difference is event handling, but in my opinion (and it might sound blasphemous), VB.NET’s event handling is actually better than C#'s.  You’ll be using syntax such as AddHandler and RemoveHandler keywords instead of C#'s += and -= respectively.  And you can explicitly designate a method as an event handler via the “Handles” keyword.  VB.NET’s syntax, while more verbose, makes it more obvious how the code works and uses really software terms for its keywords such as “Inherits”, “Implements”, “Handles”, etc.  That aspect of the language is kind of nice.

   https://msdn.microsoft.com/en-us/library/ms172877.aspx

The link for the tutorial is broken 404 :frowning:
Anyone got the backup?

thanks

Sorry about that! I switched hosting providers and am trying to extract the tutorial off the old one so I can put it up again. 

Edit: The link should be working again!

nice… thanks spacewolf!