Browse Source

Added Orientation Sample for Android

Dean Ellis 13 years ago
parent
commit
3ed02916e0

+ 28 - 0
Samples/Android/Orientation/Activity1.cs

@@ -0,0 +1,28 @@
+using System;
+
+using Android.App;
+using Android.Content;
+using Android.Runtime;
+using Android.Views;
+using Android.Widget;
+using Android.OS;
+using Microsoft.Xna.Framework;
+
+namespace Orientation
+{
+	[Activity (Label = "Orientation", MainLauncher = true)]
+	public class Activity1 : AndroidGameActivity
+	{
+		protected override void OnCreate (Bundle bundle)
+		{
+			base.OnCreate (bundle);
+			
+			OrientationSample.OrientationSample.Activity = this;
+			OrientationSample.OrientationSample g = new OrientationSample.OrientationSample();						
+			SetContentView (g.Window);
+			g.Run();
+		}
+	}
+}
+
+

+ 60 - 0
Samples/Android/Orientation/Assets/Content/Font.spritefont

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+This file contains an xml description of a font, and will be read by the XNA
+Framework Content Pipeline. Follow the comments to customize the appearance
+of the font in your game, and to change the characters which are available to draw
+with.
+-->
+<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
+  <Asset Type="Graphics:FontDescription">
+
+    <!--
+    Modify this string to change the font that will be imported.
+    -->
+    <FontName>Segoe UI Mono</FontName>
+
+    <!--
+    Size is a float value, measured in points. Modify this value to change
+    the size of the font.
+    -->
+    <Size>14</Size>
+
+    <!--
+    Spacing is a float value, measured in pixels. Modify this value to change
+    the amount of spacing in between characters.
+    -->
+    <Spacing>0</Spacing>
+
+    <!--
+    UseKerning controls the layout of the font. If this value is true, kerning information
+    will be used when placing characters.
+    -->
+    <UseKerning>true</UseKerning>
+
+    <!--
+    Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
+    and "Bold, Italic", and are case sensitive.
+    -->
+    <Style>Regular</Style>
+
+    <!--
+    If you uncomment this line, the default character will be substituted if you draw
+    or measure text that contains characters which were not included in the font.
+    -->
+    <!-- <DefaultCharacter>*</DefaultCharacter> -->
+
+    <!--
+    CharacterRegions control what letters are available in the font. Every
+    character from Start to End will be built and made available for drawing. The
+    default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
+    character set. The characters are ordered according to the Unicode standard.
+    See the documentation for more information.
+    -->
+    <CharacterRegions>
+      <CharacterRegion>
+        <Start>&#32;</Start>
+        <End>&#126;</End>
+      </CharacterRegion>
+    </CharacterRegions>
+  </Asset>
+</XnaContent>

BIN
Samples/Android/Orientation/Assets/Content/directions.png


BIN
Samples/Android/Orientation/Background.png


BIN
Samples/Android/Orientation/GameThumbnail.png


+ 231 - 0
Samples/Android/Orientation/LayoutSample.cs

@@ -0,0 +1,231 @@
+#region File Information
+//-----------------------------------------------------------------------------
+// LayoutSample.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+#endregion
+
+#region Using Statements
+using System;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Input.Touch;
+#endregion
+
+namespace LayoutSample
+{
+    /// <summary>
+    /// This is the main type for your game
+    /// </summary>
+    public class LayoutSample : Microsoft.Xna.Framework.Game
+    {
+        #region Fields
+        
+        GraphicsDeviceManager graphics;
+        SpriteBatch spriteBatch;
+
+        Texture2D directions;
+        SpriteFont font;
+
+        // Is the orientation locked?
+        bool orientationLocked = false;
+
+        // Do we allow dynamically locking/unlocking the orientation?
+        bool enableOrientationLocking = false;
+
+        #endregion
+
+        #region Initialization
+
+        public LayoutSample()
+        {
+            graphics = new GraphicsDeviceManager(this);
+            Content.RootDirectory = "Content";
+
+            // Frame rate is 30 fps by default for Windows Phone.
+            TargetElapsedTime = TimeSpan.FromTicks(333333);
+
+            // DISCLAMER:
+            // Four different scenarios for initializing orientation support are presented below.
+            // The first two scenarios are the most common and are recommended for use in most
+            // cases; the third scenario is a special case to show the hardware scalar work
+            // result; the fourth scenario is for special cases where games want to dynamically
+            // support both the landscape and portrait orientations
+
+            // Scenario #1 (default):
+            // SupportedOrientations not changed, so the game will support Landscape orientation only
+
+            // Scenario #2: 
+            // SupportedOrientations changed to support the Portrait mode only
+            // (Uncomment the following two lines)
+            // graphics.PreferredBackBufferWidth = 480;
+            // graphics.PreferredBackBufferHeight = 800;
+
+            // Scenario #3:
+            // SupportedOrientations not changed (default), thus game will support the Landscape 
+            // orientations only, but resolution set to half. This makes the hardware scalar work and 
+            // automatically scales the presentation to the device's physical resolution
+            // (Uncomment the following two lines):
+            // graphics.PreferredBackBufferWidth = 400;
+            // graphics.PreferredBackBufferHeight = 240;
+
+            // Scenario #4: 
+            // Game supports all possible orientations and enablyes dynamically locking/unlocking the
+            // orientation.
+            // (Uncomment the following lines):
+            // graphics.SupportedOrientations = DisplayOrientation.Portrait |
+            //                                  DisplayOrientation.LandscapeLeft |
+            //                                  DisplayOrientation.LandscapeRight;
+            // enableOrientationLocking = true;
+
+            // Switch to full screen mode
+            graphics.IsFullScreen = true;
+        }
+
+        /// <summary>
+        /// Allows the game to perform any initialization it needs to before starting to run.
+        /// This is where it can query for any required services and load any non-graphic
+        /// related content.  Calling base.Initialize will enumerate through any components
+        /// and initialize them as well.
+        /// </summary>
+        protected override void Initialize()
+        {
+            // For scenario #4, we handle locking/unlocking the orientation by detecting the tap gesture.
+            TouchPanel.EnabledGestures = GestureType.Tap;
+
+            base.Initialize();
+        }
+
+        #endregion
+
+        #region Load and Unload
+
+        /// <summary>
+        /// LoadContent will be called once per game and is the place to load
+        /// all of your content.
+        /// </summary>
+        protected override void LoadContent()
+        {
+            // Create a new SpriteBatch, which can be used to draw textures.
+            spriteBatch = new SpriteBatch(GraphicsDevice);
+
+            directions = Content.Load<Texture2D>("directions");
+            font = Content.Load<SpriteFont>("Font");
+        }
+
+        /// <summary>
+        /// UnloadContent will be called once per game and is the place to unload
+        /// all content.
+        /// </summary>
+        protected override void UnloadContent()
+        {
+            // Nothing to unload in this sample
+        }
+
+        #endregion
+
+        #region Update and Render
+
+        /// <summary>
+        /// Allows the game to run logic such as updating the world,
+        /// checking for collisions, gathering input, and playing audio.
+        /// </summary>
+        /// <param name="gameTime">Provides a snapshot of timing values.</param>
+        protected override void Update(GameTime gameTime)
+        {
+            // Allows the game to exit
+            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
+                this.Exit();
+
+            // If we enable locking/unlocking the orientation...
+            if (enableOrientationLocking)
+            {
+                // Read the gestures from the touch panel
+                while (TouchPanel.IsGestureAvailable)
+                {
+                    GestureSample gesture = TouchPanel.ReadGesture();
+
+                    // If the user tapped on the screen...
+                    if (gesture.GestureType == GestureType.Tap)
+                    {
+                        // Toggle the orientation locked state
+                        orientationLocked = !orientationLocked;
+
+                        if (orientationLocked)
+                        {
+                            // If we're locking the orientation, we want to store the current
+                            // orientation as well as the current viewport size. we have to
+                            // store the viewport size because when we call ApplyChanges(),
+                            // our back buffer may change and we want to make sure that it
+                            // remains at the current size, rather than any previously set
+                            // preferred size.
+                            graphics.SupportedOrientations = Window.CurrentOrientation;
+                            graphics.PreferredBackBufferWidth = GraphicsDevice.Viewport.Width;
+                            graphics.PreferredBackBufferHeight = GraphicsDevice.Viewport.Height;
+
+                        }
+                        else
+                        {
+                            // If we're unlocking the orientation, we simply set our 
+                            // supported orientations back to all orientations
+                            graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft |
+                                                             DisplayOrientation.LandscapeRight |
+                                                             DisplayOrientation.Portrait;
+                        }
+
+                        // ApplyChanges needs to be called if SupportedOrientations was changed
+                        graphics.ApplyChanges();
+                    }
+                }
+            }
+
+            base.Update(gameTime);
+        }
+
+        /// <summary>
+        /// This is called when the game should draw itself.
+        /// </summary>
+        /// <param name="gameTime">Provides a snapshot of timing values.</param>
+        protected override void Draw(GameTime gameTime)
+        {
+            GraphicsDevice.Clear(Color.CornflowerBlue);
+
+            spriteBatch.Begin();
+
+            // Draw the directions texture centered on the screen
+            Vector2 position = new Vector2(
+               GraphicsDevice.Viewport.Width / 2 - directions.Width / 2,
+               GraphicsDevice.Viewport.Height / 2 - directions.Height / 2);
+
+            spriteBatch.Draw(directions, position, Color.White);
+
+            // If we allow locking/unlocking of the orientation, draw the instructions to
+            // the screen.
+            if (enableOrientationLocking)
+            {
+                // Create a string of our current state
+                string currentState = orientationLocked 
+                    ? "Orientation: Locked" 
+                    : "Orientation: Unlocked";
+
+                // Create a string for the instructions
+                string instructions = orientationLocked 
+                    ? "Tap to unlock orientation." 
+                    : "Tap to lock orientation.";
+
+                // Draw the text to the screen
+                spriteBatch.DrawString(font, currentState, new Vector2(10, 10), Color.White);
+                spriteBatch.DrawString(font, instructions, new Vector2(10, 25), Color.White);
+            }
+
+            spriteBatch.End();
+
+            base.Draw(gameTime);
+        }
+
+        #endregion
+    }
+}

+ 88 - 0
Samples/Android/Orientation/Orientation.csproj

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.0</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{0A5F2E21-0B29-4627-8F06-28BA442B21F7}</ProjectGuid>
+    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <RootNamespace>Orientation</RootNamespace>
+    <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
+    <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
+    <AndroidResgenClass>Resource</AndroidResgenClass>
+    <AndroidApplication>True</AndroidApplication>
+    <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
+    <AssemblyName>Orientation</AssemblyName>
+    <TargetFrameworkVersion>v2.3</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+    <AndroidLinkMode>None</AndroidLinkMode>
+    <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
+    <ConsolePause>false</ConsolePause>
+    <AndroidLinkMode>SdkOnly</AndroidLinkMode>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="Mono.Android" />
+    <Reference Include="OpenTK" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Activity1.cs" />
+    <Compile Include="Resources\Resource.designer.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="LayoutSample.cs" />
+    <Compile Include="OrientationSample.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <AndroidResource Include="Resources\drawable\Icon.png" />
+  </ItemGroup>
+  <Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
+  <ItemGroup>
+    <Folder Include="Assets\" />
+    <Folder Include="Resources\values\" />
+    <Folder Include="Resources\layout\" />
+    <Folder Include="Assets\Content\" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\MonoGame\ThirdParty\Lidgren.Network\Lidgren.Network.Android.csproj">
+      <Project>{565129E0-4EE5-4F6F-B403-C3484C9740BE}</Project>
+      <Name>Lidgren.Network.Android</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.Android.csproj">
+      <Project>{BA9476CF-99BA-4D03-92F2-73D2C5E58883}</Project>
+      <Name>MonoGame.Framework.Android</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <AndroidAsset Include="Assets\Content\directions.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </AndroidAsset>
+    <AndroidAsset Include="Assets\Content\Font.spritefont">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </AndroidAsset>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Background.png" />
+    <None Include="GameThumbnail.png" />
+  </ItemGroup>
+</Project>

+ 231 - 0
Samples/Android/Orientation/OrientationSample.cs

@@ -0,0 +1,231 @@
+#region File Information
+//-----------------------------------------------------------------------------
+// OrientationSample.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+#endregion
+
+#region Using Statements
+using System;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Input.Touch;
+#endregion
+
+namespace OrientationSample
+{
+    /// <summary>
+    /// This is the main type for your game
+    /// </summary>
+    public class OrientationSample : Microsoft.Xna.Framework.Game
+    {
+        #region Fields
+        
+        GraphicsDeviceManager graphics;
+        SpriteBatch spriteBatch;
+
+        Texture2D directions;
+        SpriteFont font;
+
+        // Is the orientation locked?
+        bool orientationLocked = false;
+
+        // Do we allow dynamically locking/unlocking the orientation?
+        bool enableOrientationLocking = false;
+
+        #endregion
+
+        #region Initialization
+
+        public OrientationSample()
+        {
+            graphics = new GraphicsDeviceManager(this);
+            Content.RootDirectory = "Content";
+
+            // Frame rate is 30 fps by default for Windows Phone.
+            TargetElapsedTime = TimeSpan.FromTicks(333333);
+
+            // DISCLAMER:
+            // Four different scenarios for initializing orientation support are presented below.
+            // The first two scenarios are the most common and are recommended for use in most
+            // cases; the third scenario is a special case to show the hardware scalar work
+            // result; the fourth scenario is for special cases where games want to dynamically
+            // support both the landscape and portrait orientations
+
+            // Scenario #1 (default):
+            // SupportedOrientations not changed, so the game will support Landscape orientation only
+
+            // Scenario #2: 
+            // SupportedOrientations changed to support the Portrait mode only
+            // (Uncomment the following two lines)
+            //graphics.PreferredBackBufferWidth = 480;
+            //graphics.PreferredBackBufferHeight = 800;
+
+            // Scenario #3:
+            // SupportedOrientations not changed (default), thus game will support the Landscape 
+            // orientations only, but resolution set to half. This makes the hardware scalar work and 
+            // automatically scales the presentation to the device's physical resolution
+            // (Uncomment the following two lines):
+            // graphics.PreferredBackBufferWidth = 400;
+            // graphics.PreferredBackBufferHeight = 240;
+
+            // Scenario #4: 
+            // Game supports all possible orientations and enablyes dynamically locking/unlocking the
+            // orientation.
+            // (Uncomment the following lines):
+            // graphics.SupportedOrientations = DisplayOrientation.Portrait |
+            //                                  DisplayOrientation.LandscapeLeft |
+            //                                  DisplayOrientation.LandscapeRight;
+            //enableOrientationLocking = true;
+
+            // Switch to full screen mode
+            graphics.IsFullScreen = true;
+        }
+
+        /// <summary>
+        /// Allows the game to perform any initialization it needs to before starting to run.
+        /// This is where it can query for any required services and load any non-graphic
+        /// related content.  Calling base.Initialize will enumerate through any components
+        /// and initialize them as well.
+        /// </summary>
+        protected override void Initialize()
+        {
+            // For scenario #4, we handle locking/unlocking the orientation by detecting the tap gesture.
+            TouchPanel.EnabledGestures = GestureType.Tap;
+
+            base.Initialize();
+        }
+
+        #endregion
+
+        #region Load and Unload
+
+        /// <summary>
+        /// LoadContent will be called once per game and is the place to load
+        /// all of your content.
+        /// </summary>
+        protected override void LoadContent()
+        {
+            // Create a new SpriteBatch, which can be used to draw textures.
+            spriteBatch = new SpriteBatch(GraphicsDevice);
+
+            directions = Content.Load<Texture2D>("directions");
+            font = Content.Load<SpriteFont>("Font");
+        }
+
+        /// <summary>
+        /// UnloadContent will be called once per game and is the place to unload
+        /// all content.
+        /// </summary>
+        protected override void UnloadContent()
+        {
+            // Nothing to unload in this sample
+        }
+
+        #endregion
+
+        #region Update and Render
+
+        /// <summary>
+        /// Allows the game to run logic such as updating the world,
+        /// checking for collisions, gathering input, and playing audio.
+        /// </summary>
+        /// <param name="gameTime">Provides a snapshot of timing values.</param>
+        protected override void Update(GameTime gameTime)
+        {
+            // Allows the game to exit
+            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
+                this.Exit();
+
+            // If we enable locking/unlocking the orientation...
+            if (enableOrientationLocking)
+            {
+                // Read the gestures from the touch panel
+                while (TouchPanel.IsGestureAvailable)
+                {
+                    GestureSample gesture = TouchPanel.ReadGesture();
+
+                    // If the user tapped on the screen...
+                    if (gesture.GestureType == GestureType.Tap)
+                    {
+                        // Toggle the orientation locked state
+                        orientationLocked = !orientationLocked;
+
+                        if (orientationLocked)
+                        {
+                            // If we're locking the orientation, we want to store the current
+                            // orientation as well as the current viewport size. we have to
+                            // store the viewport size because when we call ApplyChanges(),
+                            // our back buffer may change and we want to make sure that it
+                            // remains at the current size, rather than any previously set
+                            // preferred size.
+                            graphics.SupportedOrientations = Window.CurrentOrientation;
+                            graphics.PreferredBackBufferWidth = GraphicsDevice.Viewport.Width;
+                            graphics.PreferredBackBufferHeight = GraphicsDevice.Viewport.Height;
+
+                        }
+                        else
+                        {
+                            // If we're unlocking the orientation, we simply set our 
+                            // supported orientations back to all orientations
+                            graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft |
+                                                             DisplayOrientation.LandscapeRight |
+                                                             DisplayOrientation.Portrait;
+                        }
+
+                        // ApplyChanges needs to be called if SupportedOrientations was changed
+                        graphics.ApplyChanges();
+                    }
+                }
+            }
+
+            base.Update(gameTime);
+        }
+
+        /// <summary>
+        /// This is called when the game should draw itself.
+        /// </summary>
+        /// <param name="gameTime">Provides a snapshot of timing values.</param>
+        protected override void Draw(GameTime gameTime)
+        {
+            GraphicsDevice.Clear(Color.CornflowerBlue);
+
+            spriteBatch.Begin();
+
+            // Draw the directions texture centered on the screen
+            Vector2 position = new Vector2(
+               GraphicsDevice.Viewport.Width / 2 - directions.Width / 2,
+               GraphicsDevice.Viewport.Height / 2 - directions.Height / 2);
+
+            spriteBatch.Draw(directions, position, Color.White);
+
+            // If we allow locking/unlocking of the orientation, draw the instructions to
+            // the screen.
+            if (enableOrientationLocking)
+            {
+                // Create a string of our current state
+                string currentState = orientationLocked 
+                    ? "Orientation: Locked" 
+                    : "Orientation: Unlocked";
+
+                // Create a string for the instructions
+                string instructions = orientationLocked 
+                    ? "Tap to unlock orientation." 
+                    : "Tap to lock orientation.";
+
+                // Draw the text to the screen
+                spriteBatch.DrawString(font, currentState, new Vector2(10, 10), Color.White);
+                spriteBatch.DrawString(font, instructions, new Vector2(10, 25), Color.White);
+            }
+
+            spriteBatch.End();
+
+            base.Draw(gameTime);
+        }
+
+        #endregion
+    }
+}

+ 28 - 0
Samples/Android/Orientation/Properties/AssemblyInfo.cs

@@ -0,0 +1,28 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using Android.App;
+
+// Information about this assembly is defined by the following attributes. 
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle("Orientation")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("d_ellis")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion("1.0.0")]
+
+// The following attributes are used to specify the signing key for the assembly, 
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+

+ 37 - 0
Samples/Android/Orientation/Resources/Resource.designer.cs

@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.488
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Orientation
+{
+	
+	
+	public partial class Resource
+	{
+		
+		public partial class Attribute
+		{
+			
+			private Attribute()
+			{
+			}
+		}
+		
+		public partial class Drawable
+		{
+			
+			// aapt resource value: 0x7f020000
+			public const int Icon = 2130837504;
+			
+			private Drawable()
+			{
+			}
+		}
+	}
+}

BIN
Samples/Android/Orientation/Resources/drawable/Icon.png


+ 7 - 1
Samples/MonoGame.Samples.Android.sln

@@ -21,12 +21,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Samples.Input", "A
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Samples.Primitives.Android", "Android\Primitives\MonoGame.Samples.Primitives.Android.csproj", "{167741E2-2D8E-474A-8D06-9ACB55F0BA83}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orientation", "Android\Orientation\Orientation.csproj", "{0A5F2E21-0B29-4627-8F06-28BA442B21F7}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{0A5F2E21-0B29-4627-8F06-28BA442B21F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0A5F2E21-0B29-4627-8F06-28BA442B21F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0A5F2E21-0B29-4627-8F06-28BA442B21F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0A5F2E21-0B29-4627-8F06-28BA442B21F7}.Release|Any CPU.Build.0 = Release|Any CPU
 		{167741E2-2D8E-474A-8D06-9ACB55F0BA83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{167741E2-2D8E-474A-8D06-9ACB55F0BA83}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{167741E2-2D8E-474A-8D06-9ACB55F0BA83}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -71,7 +77,7 @@ Global
 		{E2B6ED3C-A769-47AF-9605-A7410F194B1C}.Release|Any CPU.Deploy.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = Android\MonoGame.Samples.Input\MonoGame.Samples.Input.csproj
+		StartupItem = Android\Orientation\Orientation.csproj
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE