创建
9
WxappCpzs.A/App.xaml
Normal file
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="WxappCpzs.A.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:WxappCpzs.A"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
14
WxappCpzs.A/App.xaml.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Windows;
|
||||
|
||||
namespace WxappCpzs.A
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
10
WxappCpzs.A/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
12
WxappCpzs.A/MainWindow.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Window x:Class="WxappCpzs.A.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WxappCpzs.A"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
24
WxappCpzs.A/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace WxappCpzs.A
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
11
WxappCpzs.A/WxappCpzs.D.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
6
WxappCpzs.Android/AndroidManifest.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:label="@string/app_name" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true">
|
||||
</application>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
14
WxappCpzs.Android/MainActivity.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace WxappCpzs.Android
|
||||
{
|
||||
[Activity(Label = "@string/app_name", MainLauncher = true)]
|
||||
public class MainActivity : Activity
|
||||
{
|
||||
protected override void OnCreate(Bundle? savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
// Set our view from the "main" layout resource
|
||||
SetContentView(Resource.Layout.activity_main);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
WxappCpzs.Android/Resources/AboutResources.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
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/
|
||||
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"
|
||||
(this is an Android convention) 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 Resource.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.
|
||||
13
WxappCpzs.Android/Resources/layout/activity_main.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/app_text"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,4 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/appicon_background" />
|
||||
<foreground android:drawable="@mipmap/appicon_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,4 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/appicon_background" />
|
||||
<foreground android:drawable="@mipmap/appicon_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
WxappCpzs.Android/Resources/mipmap-hdpi/appicon.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-hdpi/appicon_background.png
Normal file
|
After Width: | Height: | Size: 97 B |
BIN
WxappCpzs.Android/Resources/mipmap-hdpi/appicon_foreground.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-mdpi/appicon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-mdpi/appicon_background.png
Normal file
|
After Width: | Height: | Size: 92 B |
BIN
WxappCpzs.Android/Resources/mipmap-mdpi/appicon_foreground.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-xhdpi/appicon.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-xhdpi/appicon_background.png
Normal file
|
After Width: | Height: | Size: 100 B |
BIN
WxappCpzs.Android/Resources/mipmap-xhdpi/appicon_foreground.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-xxhdpi/appicon.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-xxhdpi/appicon_background.png
Normal file
|
After Width: | Height: | Size: 108 B |
BIN
WxappCpzs.Android/Resources/mipmap-xxhdpi/appicon_foreground.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
WxappCpzs.Android/Resources/mipmap-xxxhdpi/appicon.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 117 B |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#2C3E50</color>
|
||||
</resources>
|
||||
4
WxappCpzs.Android/Resources/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">WxappCpzs.Android</string>
|
||||
<string name="app_text">Hello, Android!</string>
|
||||
</resources>
|
||||
12
WxappCpzs.Android/WxappCpzs.Android.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-android</TargetFramework>
|
||||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
|
||||
<OutputType>Exe</OutputType>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ApplicationId>com.wxapp.cpzs.AndroidApp</ApplicationId>
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34219.65
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WxappCpzs", "WxappCpzs\WxappCpzs.csproj", "{3270957E-F0F0-4C07-B89B-5D43E57F635D}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WxappCpzs", "WxappCpzs\WxappCpzs.csproj", "{3270957E-F0F0-4C07-B89B-5D43E57F635D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WxappCpzs.D", "WxappCpzs.A\WxappCpzs.D.csproj", "{DE405B3C-FCF6-4484-A633-02E1BE946A7F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WxappCpzs.Android", "WxappCpzs.Android\WxappCpzs.Android.csproj", "{832C8398-BF5C-4045-B4EA-9F5FF48C6A63}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -15,6 +19,16 @@ Global
|
||||
{3270957E-F0F0-4C07-B89B-5D43E57F635D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3270957E-F0F0-4C07-B89B-5D43E57F635D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3270957E-F0F0-4C07-B89B-5D43E57F635D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DE405B3C-FCF6-4484-A633-02E1BE946A7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DE405B3C-FCF6-4484-A633-02E1BE946A7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DE405B3C-FCF6-4484-A633-02E1BE946A7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DE405B3C-FCF6-4484-A633-02E1BE946A7F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{832C8398-BF5C-4045-B4EA-9F5FF48C6A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{832C8398-BF5C-4045-B4EA-9F5FF48C6A63}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{832C8398-BF5C-4045-B4EA-9F5FF48C6A63}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{832C8398-BF5C-4045-B4EA-9F5FF48C6A63}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{832C8398-BF5C-4045-B4EA-9F5FF48C6A63}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{832C8398-BF5C-4045-B4EA-9F5FF48C6A63}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||