Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example how to monetize yours Xamarin.Forms applications with AdMob by Google -
using Android.App;
using Android.Content.PM;
using Android.Gms.Ads;
using Android.OS;
namespace DemoAdMob.Droid
[Activity(Label = "DemoAdMob", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
protected override void OnCreate(Bundle bundle)
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
MobileAds.Initialize(ApplicationContext, "SEU ID ANDROID");
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.