init commit
This commit is contained in:
68
admobDemo.AndroidPhone/Activity1.cs
Normal file
68
admobDemo.AndroidPhone/Activity1.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Author: Tommy James Parnell
|
||||
// notes: Tutorial to show how admob works in xamarin
|
||||
// email: tparnell8@gmail.com, parnell.tommy@hotmail.com
|
||||
|
||||
using System;
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.OS;
|
||||
using Android.Gms.Ads;
|
||||
using admobDemo;
|
||||
using admobDemo.AndroidPhone.ad;
|
||||
namespace admobDemo.AndroidPhone
|
||||
{
|
||||
[Activity(Label = "admobDemo.AndroidPhone", MainLauncher = true, Icon = "@drawable/icon")]
|
||||
public class Activity1 : Activity
|
||||
{
|
||||
int count = 1;
|
||||
AdView _bannerad;
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
base.OnCreate(bundle);
|
||||
|
||||
// Set our view from the "main" layout resource
|
||||
SetContentView(Resource.Layout.Main);
|
||||
|
||||
// Get our button from the layout resource,
|
||||
// and attach an event to it
|
||||
Button button = FindViewById<Button>(Resource.Id.MyButton);
|
||||
|
||||
button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
|
||||
|
||||
//----------------------------------------------banner add stuff
|
||||
_bannerad = AdWrapper.ConstructStandardBanner(this, AdSize.SmartBanner, "your ad id here");
|
||||
var listener = new admobDemo.adlistener();
|
||||
listener.AdLoaded += () => { };
|
||||
_bannerad.AdListener = listener;
|
||||
_bannerad.CustomBuild();
|
||||
var layout = FindViewById<LinearLayout>(Resource.Id.mainlayout);
|
||||
layout.AddView(_bannerad);
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
//-------------------------------------------------InterstitialAd stuff
|
||||
var FinalAd = AdWrapper.ConstructFullPageAdd(this, "your ad id here");
|
||||
var intlistener = new admobDemo.adlistener();
|
||||
listener.AdLoaded += () => { if (FinalAd.IsLoaded)FinalAd.Show(); };
|
||||
FinalAd.AdListener = listener;
|
||||
FinalAd.CustomBuild();
|
||||
//-------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
if (_bannerad != null) _bannerad.Resume();
|
||||
base.OnResume();
|
||||
}
|
||||
protected override void OnPause()
|
||||
{
|
||||
if(_bannerad != null)_bannerad.Pause();
|
||||
base.OnPause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
19
admobDemo.AndroidPhone/Assets/AboutAssets.txt
Normal file
19
admobDemo.AndroidPhone/Assets/AboutAssets.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with you package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
||||
8
admobDemo.AndroidPhone/Properties/AndroidManifest.xml
Normal file
8
admobDemo.AndroidPhone/Properties/AndroidManifest.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15" />
|
||||
<application>
|
||||
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
|
||||
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
|
||||
</application>
|
||||
</manifest>
|
||||
40
admobDemo.AndroidPhone/Properties/AssemblyInfo.cs
Normal file
40
admobDemo.AndroidPhone/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("admobDemo.AndroidPhone")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("admobDemo.AndroidPhone")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteSecureSettings)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteProfile)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.ReadContacts)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteContacts)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.ReceiveBootCompleted)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.AccessNetworkState)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
||||
50
admobDemo.AndroidPhone/Resources/AboutResources.txt
Normal file
50
admobDemo.AndroidPhone/Resources/AboutResources.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.xml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable-hdpi/
|
||||
icon.png
|
||||
|
||||
drawable-ldpi/
|
||||
icon.png
|
||||
|
||||
drawable-mdpi/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.xml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called
|
||||
"Resource" that contains the tokens for each one of the resources included. For example,
|
||||
for the above Resources layout, this is what the Resource class would expose:
|
||||
|
||||
public class Resource {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
|
||||
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
||||
BIN
admobDemo.AndroidPhone/Resources/Drawable/Icon.png
Normal file
BIN
admobDemo.AndroidPhone/Resources/Drawable/Icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
12
admobDemo.AndroidPhone/Resources/Layout/Main.axml
Normal file
12
admobDemo.AndroidPhone/Resources/Layout/Main.axml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:id="@+id/mainlayout">
|
||||
<Button
|
||||
android:id="@+id/MyButton"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/Hello" />
|
||||
</LinearLayout>
|
||||
495
admobDemo.AndroidPhone/Resources/Resource.Designer.cs
generated
Normal file
495
admobDemo.AndroidPhone/Resources/Resource.Designer.cs
generated
Normal file
@@ -0,0 +1,495 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34011
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
[assembly: global::Android.Runtime.ResourceDesignerAttribute("admobDemo.AndroidPhone.Resource", IsApplication=true)]
|
||||
|
||||
namespace admobDemo.AndroidPhone
|
||||
{
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
|
||||
public partial class Resource
|
||||
{
|
||||
|
||||
static Resource()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
public static void UpdateIdValues()
|
||||
{
|
||||
global::admobDemo.Resource.String.ApplicationName = global::admobDemo.AndroidPhone.Resource.String.ApplicationName;
|
||||
global::admobDemo.Resource.String.Hello = global::admobDemo.AndroidPhone.Resource.String.Hello;
|
||||
}
|
||||
|
||||
public partial class Attribute
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f010000
|
||||
public const int adSize = 2130771968;
|
||||
|
||||
// aapt resource value: 0x7f010001
|
||||
public const int adSizes = 2130771969;
|
||||
|
||||
// aapt resource value: 0x7f010002
|
||||
public const int adUnitId = 2130771970;
|
||||
|
||||
// aapt resource value: 0x7f010004
|
||||
public const int cameraBearing = 2130771972;
|
||||
|
||||
// aapt resource value: 0x7f010005
|
||||
public const int cameraTargetLat = 2130771973;
|
||||
|
||||
// aapt resource value: 0x7f010006
|
||||
public const int cameraTargetLng = 2130771974;
|
||||
|
||||
// aapt resource value: 0x7f010007
|
||||
public const int cameraTilt = 2130771975;
|
||||
|
||||
// aapt resource value: 0x7f010008
|
||||
public const int cameraZoom = 2130771976;
|
||||
|
||||
// aapt resource value: 0x7f010003
|
||||
public const int mapType = 2130771971;
|
||||
|
||||
// aapt resource value: 0x7f010009
|
||||
public const int uiCompass = 2130771977;
|
||||
|
||||
// aapt resource value: 0x7f01000a
|
||||
public const int uiRotateGestures = 2130771978;
|
||||
|
||||
// aapt resource value: 0x7f01000b
|
||||
public const int uiScrollGestures = 2130771979;
|
||||
|
||||
// aapt resource value: 0x7f01000c
|
||||
public const int uiTiltGestures = 2130771980;
|
||||
|
||||
// aapt resource value: 0x7f01000d
|
||||
public const int uiZoomControls = 2130771981;
|
||||
|
||||
// aapt resource value: 0x7f01000e
|
||||
public const int uiZoomGestures = 2130771982;
|
||||
|
||||
// aapt resource value: 0x7f01000f
|
||||
public const int useViewLifecycle = 2130771983;
|
||||
|
||||
// aapt resource value: 0x7f010010
|
||||
public const int zOrderOnTop = 2130771984;
|
||||
|
||||
static Attribute()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Attribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Color
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f040009
|
||||
public const int common_action_bar_splitter = 2130968585;
|
||||
|
||||
// aapt resource value: 0x7f040000
|
||||
public const int common_signin_btn_dark_text_default = 2130968576;
|
||||
|
||||
// aapt resource value: 0x7f040002
|
||||
public const int common_signin_btn_dark_text_disabled = 2130968578;
|
||||
|
||||
// aapt resource value: 0x7f040003
|
||||
public const int common_signin_btn_dark_text_focused = 2130968579;
|
||||
|
||||
// aapt resource value: 0x7f040001
|
||||
public const int common_signin_btn_dark_text_pressed = 2130968577;
|
||||
|
||||
// aapt resource value: 0x7f040008
|
||||
public const int common_signin_btn_default_background = 2130968584;
|
||||
|
||||
// aapt resource value: 0x7f040004
|
||||
public const int common_signin_btn_light_text_default = 2130968580;
|
||||
|
||||
// aapt resource value: 0x7f040006
|
||||
public const int common_signin_btn_light_text_disabled = 2130968582;
|
||||
|
||||
// aapt resource value: 0x7f040007
|
||||
public const int common_signin_btn_light_text_focused = 2130968583;
|
||||
|
||||
// aapt resource value: 0x7f040005
|
||||
public const int common_signin_btn_light_text_pressed = 2130968581;
|
||||
|
||||
// aapt resource value: 0x7f04000a
|
||||
public const int common_signin_btn_text_dark = 2130968586;
|
||||
|
||||
// aapt resource value: 0x7f04000b
|
||||
public const int common_signin_btn_text_light = 2130968587;
|
||||
|
||||
static Color()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Color()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Drawable
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f020000
|
||||
public const int common_signin_btn_icon_dark = 2130837504;
|
||||
|
||||
// aapt resource value: 0x7f020001
|
||||
public const int common_signin_btn_icon_disabled_dark = 2130837505;
|
||||
|
||||
// aapt resource value: 0x7f020002
|
||||
public const int common_signin_btn_icon_disabled_focus_dark = 2130837506;
|
||||
|
||||
// aapt resource value: 0x7f020003
|
||||
public const int common_signin_btn_icon_disabled_focus_light = 2130837507;
|
||||
|
||||
// aapt resource value: 0x7f020004
|
||||
public const int common_signin_btn_icon_disabled_light = 2130837508;
|
||||
|
||||
// aapt resource value: 0x7f020005
|
||||
public const int common_signin_btn_icon_focus_dark = 2130837509;
|
||||
|
||||
// aapt resource value: 0x7f020006
|
||||
public const int common_signin_btn_icon_focus_light = 2130837510;
|
||||
|
||||
// aapt resource value: 0x7f020007
|
||||
public const int common_signin_btn_icon_light = 2130837511;
|
||||
|
||||
// aapt resource value: 0x7f020008
|
||||
public const int common_signin_btn_icon_normal_dark = 2130837512;
|
||||
|
||||
// aapt resource value: 0x7f020009
|
||||
public const int common_signin_btn_icon_normal_light = 2130837513;
|
||||
|
||||
// aapt resource value: 0x7f02000a
|
||||
public const int common_signin_btn_icon_pressed_dark = 2130837514;
|
||||
|
||||
// aapt resource value: 0x7f02000b
|
||||
public const int common_signin_btn_icon_pressed_light = 2130837515;
|
||||
|
||||
// aapt resource value: 0x7f02000c
|
||||
public const int common_signin_btn_text_dark = 2130837516;
|
||||
|
||||
// aapt resource value: 0x7f02000d
|
||||
public const int common_signin_btn_text_disabled_dark = 2130837517;
|
||||
|
||||
// aapt resource value: 0x7f02000e
|
||||
public const int common_signin_btn_text_disabled_focus_dark = 2130837518;
|
||||
|
||||
// aapt resource value: 0x7f02000f
|
||||
public const int common_signin_btn_text_disabled_focus_light = 2130837519;
|
||||
|
||||
// aapt resource value: 0x7f020010
|
||||
public const int common_signin_btn_text_disabled_light = 2130837520;
|
||||
|
||||
// aapt resource value: 0x7f020011
|
||||
public const int common_signin_btn_text_focus_dark = 2130837521;
|
||||
|
||||
// aapt resource value: 0x7f020012
|
||||
public const int common_signin_btn_text_focus_light = 2130837522;
|
||||
|
||||
// aapt resource value: 0x7f020013
|
||||
public const int common_signin_btn_text_light = 2130837523;
|
||||
|
||||
// aapt resource value: 0x7f020014
|
||||
public const int common_signin_btn_text_normal_dark = 2130837524;
|
||||
|
||||
// aapt resource value: 0x7f020015
|
||||
public const int common_signin_btn_text_normal_light = 2130837525;
|
||||
|
||||
// aapt resource value: 0x7f020016
|
||||
public const int common_signin_btn_text_pressed_dark = 2130837526;
|
||||
|
||||
// aapt resource value: 0x7f020017
|
||||
public const int common_signin_btn_text_pressed_light = 2130837527;
|
||||
|
||||
// aapt resource value: 0x7f020018
|
||||
public const int ic_plusone_medium_off_client = 2130837528;
|
||||
|
||||
// aapt resource value: 0x7f020019
|
||||
public const int ic_plusone_small_off_client = 2130837529;
|
||||
|
||||
// aapt resource value: 0x7f02001a
|
||||
public const int ic_plusone_standard_off_client = 2130837530;
|
||||
|
||||
// aapt resource value: 0x7f02001b
|
||||
public const int ic_plusone_tall_off_client = 2130837531;
|
||||
|
||||
// aapt resource value: 0x7f02001c
|
||||
public const int Icon = 2130837532;
|
||||
|
||||
static Drawable()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Drawable()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Id
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f050006
|
||||
public const int MyButton = 2131034118;
|
||||
|
||||
// aapt resource value: 0x7f050004
|
||||
public const int hybrid = 2131034116;
|
||||
|
||||
// aapt resource value: 0x7f050005
|
||||
public const int mainlayout = 2131034117;
|
||||
|
||||
// aapt resource value: 0x7f050000
|
||||
public const int none = 2131034112;
|
||||
|
||||
// aapt resource value: 0x7f050001
|
||||
public const int normal = 2131034113;
|
||||
|
||||
// aapt resource value: 0x7f050002
|
||||
public const int satellite = 2131034114;
|
||||
|
||||
// aapt resource value: 0x7f050003
|
||||
public const int terrain = 2131034115;
|
||||
|
||||
static Id()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Id()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Integer
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f070000
|
||||
public const int google_play_services_version = 2131165184;
|
||||
|
||||
static Integer()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Integer()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Layout
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f030000
|
||||
public const int Main = 2130903040;
|
||||
|
||||
static Layout()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Layout()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class String
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f06001b
|
||||
public const int ApplicationName = 2131099675;
|
||||
|
||||
// aapt resource value: 0x7f06001a
|
||||
public const int Hello = 2131099674;
|
||||
|
||||
// aapt resource value: 0x7f060015
|
||||
public const int auth_client_needs_enabling_title = 2131099669;
|
||||
|
||||
// aapt resource value: 0x7f060016
|
||||
public const int auth_client_needs_installation_title = 2131099670;
|
||||
|
||||
// aapt resource value: 0x7f060017
|
||||
public const int auth_client_needs_update_title = 2131099671;
|
||||
|
||||
// aapt resource value: 0x7f060018
|
||||
public const int auth_client_play_services_err_notification_msg = 2131099672;
|
||||
|
||||
// aapt resource value: 0x7f060019
|
||||
public const int auth_client_requested_by_msg = 2131099673;
|
||||
|
||||
// aapt resource value: 0x7f060014
|
||||
public const int auth_client_using_bad_version_title = 2131099668;
|
||||
|
||||
// aapt resource value: 0x7f060006
|
||||
public const int common_google_play_services_enable_button = 2131099654;
|
||||
|
||||
// aapt resource value: 0x7f060005
|
||||
public const int common_google_play_services_enable_text = 2131099653;
|
||||
|
||||
// aapt resource value: 0x7f060004
|
||||
public const int common_google_play_services_enable_title = 2131099652;
|
||||
|
||||
// aapt resource value: 0x7f060003
|
||||
public const int common_google_play_services_install_button = 2131099651;
|
||||
|
||||
// aapt resource value: 0x7f060001
|
||||
public const int common_google_play_services_install_text_phone = 2131099649;
|
||||
|
||||
// aapt resource value: 0x7f060002
|
||||
public const int common_google_play_services_install_text_tablet = 2131099650;
|
||||
|
||||
// aapt resource value: 0x7f060000
|
||||
public const int common_google_play_services_install_title = 2131099648;
|
||||
|
||||
// aapt resource value: 0x7f06000c
|
||||
public const int common_google_play_services_invalid_account_text = 2131099660;
|
||||
|
||||
// aapt resource value: 0x7f06000b
|
||||
public const int common_google_play_services_invalid_account_title = 2131099659;
|
||||
|
||||
// aapt resource value: 0x7f06000a
|
||||
public const int common_google_play_services_network_error_text = 2131099658;
|
||||
|
||||
// aapt resource value: 0x7f060009
|
||||
public const int common_google_play_services_network_error_title = 2131099657;
|
||||
|
||||
// aapt resource value: 0x7f06000d
|
||||
public const int common_google_play_services_unknown_issue = 2131099661;
|
||||
|
||||
// aapt resource value: 0x7f060010
|
||||
public const int common_google_play_services_unsupported_date_text = 2131099664;
|
||||
|
||||
// aapt resource value: 0x7f06000f
|
||||
public const int common_google_play_services_unsupported_text = 2131099663;
|
||||
|
||||
// aapt resource value: 0x7f06000e
|
||||
public const int common_google_play_services_unsupported_title = 2131099662;
|
||||
|
||||
// aapt resource value: 0x7f060011
|
||||
public const int common_google_play_services_update_button = 2131099665;
|
||||
|
||||
// aapt resource value: 0x7f060008
|
||||
public const int common_google_play_services_update_text = 2131099656;
|
||||
|
||||
// aapt resource value: 0x7f060007
|
||||
public const int common_google_play_services_update_title = 2131099655;
|
||||
|
||||
// aapt resource value: 0x7f060012
|
||||
public const int common_signin_button_text = 2131099666;
|
||||
|
||||
// aapt resource value: 0x7f060013
|
||||
public const int common_signin_button_text_long = 2131099667;
|
||||
|
||||
static String()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private String()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Styleable
|
||||
{
|
||||
|
||||
public static int[] AdsAttrs = new int[] {
|
||||
2130771968,
|
||||
2130771969,
|
||||
2130771970};
|
||||
|
||||
// aapt resource value: 0
|
||||
public const int AdsAttrs_adSize = 0;
|
||||
|
||||
// aapt resource value: 1
|
||||
public const int AdsAttrs_adSizes = 1;
|
||||
|
||||
// aapt resource value: 2
|
||||
public const int AdsAttrs_adUnitId = 2;
|
||||
|
||||
public static int[] MapAttrs = new int[] {
|
||||
2130771971,
|
||||
2130771972,
|
||||
2130771973,
|
||||
2130771974,
|
||||
2130771975,
|
||||
2130771976,
|
||||
2130771977,
|
||||
2130771978,
|
||||
2130771979,
|
||||
2130771980,
|
||||
2130771981,
|
||||
2130771982,
|
||||
2130771983,
|
||||
2130771984};
|
||||
|
||||
// aapt resource value: 1
|
||||
public const int MapAttrs_cameraBearing = 1;
|
||||
|
||||
// aapt resource value: 2
|
||||
public const int MapAttrs_cameraTargetLat = 2;
|
||||
|
||||
// aapt resource value: 3
|
||||
public const int MapAttrs_cameraTargetLng = 3;
|
||||
|
||||
// aapt resource value: 4
|
||||
public const int MapAttrs_cameraTilt = 4;
|
||||
|
||||
// aapt resource value: 5
|
||||
public const int MapAttrs_cameraZoom = 5;
|
||||
|
||||
// aapt resource value: 0
|
||||
public const int MapAttrs_mapType = 0;
|
||||
|
||||
// aapt resource value: 6
|
||||
public const int MapAttrs_uiCompass = 6;
|
||||
|
||||
// aapt resource value: 7
|
||||
public const int MapAttrs_uiRotateGestures = 7;
|
||||
|
||||
// aapt resource value: 8
|
||||
public const int MapAttrs_uiScrollGestures = 8;
|
||||
|
||||
// aapt resource value: 9
|
||||
public const int MapAttrs_uiTiltGestures = 9;
|
||||
|
||||
// aapt resource value: 10
|
||||
public const int MapAttrs_uiZoomControls = 10;
|
||||
|
||||
// aapt resource value: 11
|
||||
public const int MapAttrs_uiZoomGestures = 11;
|
||||
|
||||
// aapt resource value: 12
|
||||
public const int MapAttrs_useViewLifecycle = 12;
|
||||
|
||||
// aapt resource value: 13
|
||||
public const int MapAttrs_zOrderOnTop = 13;
|
||||
|
||||
static Styleable()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Styleable()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
5
admobDemo.AndroidPhone/Resources/Values/Strings.xml
Normal file
5
admobDemo.AndroidPhone/Resources/Values/Strings.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="Hello">Hello World, Click Me!</string>
|
||||
<string name="ApplicationName">admobDemo.AndroidPhone</string>
|
||||
</resources>
|
||||
51
admobDemo.AndroidPhone/ad/AdEventListener.cs
Normal file
51
admobDemo.AndroidPhone/ad/AdEventListener.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
// Author: Tommy James Parnell
|
||||
// notes: Tutorial to show how admob works in xamarin
|
||||
// email: tparnell8@gmail.com, parnell.tommy@hotmail.com
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.Gms.Ads;
|
||||
|
||||
namespace admobDemo
|
||||
{
|
||||
class adlistener : AdListener
|
||||
{
|
||||
// Declare the delegate (if using non-generic pattern).
|
||||
public delegate void AdLoadedEvent();
|
||||
public delegate void AdClosedEvent();
|
||||
public delegate void AdOpenedEvent();
|
||||
|
||||
|
||||
|
||||
// Declare the event.
|
||||
public event AdLoadedEvent AdLoaded;
|
||||
public event AdClosedEvent AdClosed;
|
||||
public event AdOpenedEvent AdOpened;
|
||||
|
||||
public override void OnAdLoaded()
|
||||
{
|
||||
if (AdLoaded != null) this.AdLoaded();
|
||||
base.OnAdLoaded();
|
||||
}
|
||||
|
||||
public override void OnAdClosed()
|
||||
{
|
||||
if (AdClosed != null) this.AdClosed();
|
||||
base.OnAdClosed();
|
||||
}
|
||||
public override void OnAdOpened()
|
||||
{
|
||||
if (AdOpened != null) this.AdOpened();
|
||||
base.OnAdOpened();
|
||||
}
|
||||
}
|
||||
}
|
||||
53
admobDemo.AndroidPhone/ad/AdWrapper.cs
Normal file
53
admobDemo.AndroidPhone/ad/AdWrapper.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
// Author: Tommy James Parnell
|
||||
// notes: Tutorial to show how admob works in xamarin
|
||||
// email: tparnell8@gmail.com, parnell.tommy@hotmail.com
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.Gms.Ads;
|
||||
|
||||
namespace admobDemo.AndroidPhone.ad
|
||||
{
|
||||
public static class AdWrapper
|
||||
{
|
||||
public static InterstitialAd ConstructFullPageAdd(Context con, string UnitID)
|
||||
{
|
||||
var ad = new InterstitialAd(con);
|
||||
ad.AdUnitId = UnitID;
|
||||
var requestbuilder = new AdRequest.Builder();
|
||||
return ad;
|
||||
}
|
||||
|
||||
public static AdView ConstructStandardBanner(Context con, AdSize adsize, string UnitID)
|
||||
{
|
||||
var ad = new AdView(con);
|
||||
ad.AdSize = adsize;
|
||||
ad.AdUnitId = UnitID;
|
||||
return ad;
|
||||
}
|
||||
|
||||
public static InterstitialAd CustomBuild(this InterstitialAd ad)
|
||||
{
|
||||
var requestbuilder = new AdRequest.Builder();
|
||||
ad.LoadAd(requestbuilder.Build());
|
||||
return ad;
|
||||
}
|
||||
|
||||
public static AdView CustomBuild(this AdView ad)
|
||||
{
|
||||
var requestbuilder = new AdRequest.Builder();
|
||||
ad.LoadAd(requestbuilder.Build());
|
||||
return ad;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
96
admobDemo.AndroidPhone/admobDemo.AndroidPhone.csproj
Normal file
96
admobDemo.AndroidPhone/admobDemo.AndroidPhone.csproj
Normal file
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D46EB512-82D3-4742-8A8E-9A1115D289B9}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>admobDemo.AndroidPhone</RootNamespace>
|
||||
<AssemblyName>admobDemo.AndroidPhone</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AndroidApplication>true</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
||||
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="GooglePlayServicesLib">
|
||||
<HintPath>..\Components\googleplayservicesjellybean-15.0.1\lib\android\GooglePlayServicesLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Activity1.cs" />
|
||||
<Compile Include="ad\AdEventListener.cs" />
|
||||
<Compile Include="ad\AdWrapper.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\Layout\Main.axml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\Values\Strings.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\Drawable\Icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\admobDemo\admobDemo.csproj">
|
||||
<Project>{7b69dc2c-3c62-401c-9cc5-e741f88eaea9}</Project>
|
||||
<Name>admobDemo</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<XamarinComponentReference Include="googleplayservicesjellybean">
|
||||
<Visible>False</Visible>
|
||||
<Version>15.0.1</Version>
|
||||
</XamarinComponentReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
Reference in New Issue
Block a user