瀏覽代碼

fixed android demo

vpenades 2 年之前
父節點
當前提交
06aab96352

+ 36 - 0
.config/dotnet-tools.json

@@ -0,0 +1,36 @@
+{
+  "version": 1,
+  "isRoot": true,
+  "tools": {
+    "dotnet-mgcb": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb"
+      ]
+    },
+    "dotnet-mgcb-editor": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor"
+      ]
+    },
+    "dotnet-mgcb-editor-linux": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor-linux"
+      ]
+    },
+    "dotnet-mgcb-editor-windows": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor-windows"
+      ]
+    },
+    "dotnet-mgcb-editor-mac": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor-mac"
+      ]
+    }
+  }
+}

+ 8 - 8
MonoScene.sln

@@ -37,7 +37,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo4.VR", "demos\Demo4.VR\
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoScene.Pipeline.Assimp", "src\MonoScene.Pipeline.Assimp\MonoScene.Pipeline.Assimp.csproj", "{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo5.Android", "demos\Demo5.Android\Demo5.Android.csproj", "{9CE794E3-3DEC-491B-8AFB-28833107D8A8}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo5.Android", "demos\Demo5.Android\Demo5.Android.csproj", "{2C14367C-43E4-40FD-90B6-F860955BF184}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -93,12 +93,12 @@ Global
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}.Release|Any CPU.Build.0 = Release|Any CPU
-		{9CE794E3-3DEC-491B-8AFB-28833107D8A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{9CE794E3-3DEC-491B-8AFB-28833107D8A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{9CE794E3-3DEC-491B-8AFB-28833107D8A8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
-		{9CE794E3-3DEC-491B-8AFB-28833107D8A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{9CE794E3-3DEC-491B-8AFB-28833107D8A8}.Release|Any CPU.Build.0 = Release|Any CPU
-		{9CE794E3-3DEC-491B-8AFB-28833107D8A8}.Release|Any CPU.Deploy.0 = Release|Any CPU
+		{2C14367C-43E4-40FD-90B6-F860955BF184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2C14367C-43E4-40FD-90B6-F860955BF184}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2C14367C-43E4-40FD-90B6-F860955BF184}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+		{2C14367C-43E4-40FD-90B6-F860955BF184}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2C14367C-43E4-40FD-90B6-F860955BF184}.Release|Any CPU.Build.0 = Release|Any CPU
+		{2C14367C-43E4-40FD-90B6-F860955BF184}.Release|Any CPU.Deploy.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -116,7 +116,7 @@ Global
 		{2BD342D9-5E43-497C-930C-7576376F6B91} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
 		{E33A8290-FFD1-44DF-B095-FF7002BE8CFE} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B} = {D3CE88C7-E423-42EF-B869-C233AE360D89}
-		{9CE794E3-3DEC-491B-8AFB-28833107D8A8} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
+		{2C14367C-43E4-40FD-90B6-F860955BF184} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {3A93E868-4176-4EB6-864F-C1CEE03ED6A5}

+ 2 - 1
demos/Demo5.Android/Activity1.cs

@@ -2,9 +2,10 @@ using Android.App;
 using Android.Content.PM;
 using Android.OS;
 using Android.Views;
+
 using Microsoft.Xna.Framework;
 
-namespace AndroidDemo1
+namespace Demo5
 {
     [Activity(
         Label = "@string/app_name",

+ 6 - 0
demos/Demo5.Android/AndroidManifest.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Demo5.Android.Demo5.Android" android:versionCode="1" android:versionName="1.0">
+  <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31" />
+  <uses-feature android:glEsVersion="0x00020000" android:required="true" />
+  <application android:label="Demo5.Android"></application>
+</manifest>

+ 15 - 0
demos/Demo5.Android/Content/Content.mgcb

@@ -0,0 +1,15 @@
+
+#----------------------------- Global Properties ----------------------------#
+
+/outputDir:bin/$(Platform)
+/intermediateDir:obj/$(Platform)
+/platform:Android
+/config:
+/profile:Reach
+/compress:False
+
+#-------------------------------- References --------------------------------#
+
+
+#---------------------------------- Content ---------------------------------#
+

+ 13 - 19
demos/Demo5.Android/Demo5.Android.csproj

@@ -1,32 +1,26 @@
 <Project Sdk="Microsoft.NET.Sdk">
-
+  
   <PropertyGroup>
     <TargetFramework>net6.0-android</TargetFramework>
-    <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
-    <OutputType>Exe</OutputType>    
-  </PropertyGroup>
-
-  <PropertyGroup>
-    <ApplicationId>com.monoscene.demo5</ApplicationId>
+    <SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
+    <OutputType>Exe</OutputType>
+    <ApplicationId>com.companyname.Demo5.Android</ApplicationId>
     <ApplicationVersion>1</ApplicationVersion>
     <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
-  </PropertyGroup>  
-
-  <PropertyGroup>
-    <IsTrimmable>false</IsTrimmable>
   </PropertyGroup>
-
-  <ItemGroup>
-    <Folder Include="Resources\drawable\" />
-  </ItemGroup>
-
+  
   <ItemGroup>
-    <Content Include="..\SharedResources\CesiumMan.glb" Link="Content\CesiumMan.glb" CopyToOutputDirectory="PreserveNewest" />
+    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
+    <PackageReference Include="MonoGame.Framework.Android" Version="3.8.1.303" />
   </ItemGroup>
+  
+  <Target Name="RestoreDotnetTools" BeforeTargets="Restore">
+    <Message Text="Restoring dotnet tools" Importance="High" />
+    <Exec Command="dotnet tool restore" />
+  </Target>
 
   <ItemGroup>
-    <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
-    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />    
+    <EmbeddedResource Include="..\SharedResources\CesiumMan.glb" Link="Content\CesiumMan.glb" />
   </ItemGroup>
 
   <ItemGroup>

+ 2 - 2
demos/Demo5.Android/Game1.cs

@@ -4,7 +4,7 @@ using Microsoft.Xna.Framework.Input;
 
 using MonoScene.Graphics;
 
-namespace AndroidDemo1
+namespace Demo5
 {
     public class Game1 : Game
     {
@@ -89,4 +89,4 @@ namespace AndroidDemo1
 
         #endregion
     }
-}
+}

+ 0 - 5
demos/Demo5.Android/Properties/AndroidManifest.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="MonoScene.Demo5" android:versionCode="1" android:versionName="1.0">
-  <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
-  <application android:label="Demo5"></application>
-</manifest>

+ 0 - 30
demos/Demo5.Android/Properties/AssemblyInfo.cs

@@ -1,30 +0,0 @@
-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("AndroidDemo1")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("AndroidDemo1")]
-[assembly: AssemblyCopyright("Copyright ©  2018")]
-[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")]

+ 0 - 76
demos/Demo5.Android/Resources/Resource.Designer.cs

@@ -1,76 +0,0 @@
-#pragma warning disable 1591
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-[assembly: global::Android.Runtime.ResourceDesignerAttribute("AndroidDemo1.Resource", IsApplication=true)]
-
-namespace AndroidDemo1
-{
-	
-	
-	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.0.11")]
-	public partial class Resource
-	{
-		
-		static Resource()
-		{
-			global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-		}
-		
-		public static void UpdateIdValues()
-		{
-		}
-		
-		public partial class Attribute
-		{
-			
-			static Attribute()
-			{
-				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-			}
-			
-			private Attribute()
-			{
-			}
-		}
-		
-		public partial class Drawable
-		{
-			
-			// aapt resource value: 0x7F010000
-			public const int Icon = 2130771968;
-			
-			static Drawable()
-			{
-				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-			}
-			
-			private Drawable()
-			{
-			}
-		}
-		
-		public partial class String
-		{
-			
-			// aapt resource value: 0x7F020000
-			public const int app_name = 2130837504;
-			
-			static String()
-			{
-				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-			}
-			
-			private String()
-			{
-			}
-		}
-	}
-}
-#pragma warning restore 1591

+ 1 - 1
demos/Demo5.Android/Resources/Values/Strings.xml

@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-  <string name="app_name">AndroidDemo1</string>
+  <string name="app_name">Demo5.Android</string>
 </resources>