Android development based on C#/.NET under Visual Studio platform

Part.I Introduction

Because I want to try the development of the mobile terminal, I simply searched the languages ​​​​that can be used for mobile terminal development on the Internet, and found that Java, C#, etc. are all available. Although most of them use Java, the author is more familiar with C#, so I started to develop Android based on C# on a whim!

Chap.I environment construction

It's very simple, create a new project in Vistual sudio, look for C#/Andriod, generally can't find it, indicating that you haven't installed it Xamarin, and then there will be "Install multiple tools or functions" in blue font below, click to check "Use .NET Mobile Development", and then modify it for installation.
insert image description here
Enable Hyper-V acceleration, if you don't enable this, debugging is super slow.

  • Type "Windows features" in the Windows Search box, and then select "Turn Windows features on or off" in the search results. In the Windows Features dialog box, enable Hyper-V and Windows Hypervisor Platform:
    insert image description here
    and restart the computer.

Part.II Example

Here's a simple example:

Create a new C# Android project
insert image description here
Expand the solution → Resourceslayout, double-click content_main.xml, and then you can add controls on it to show your talents!

insert image description here
Then set the debugging to Debugmode, click the green triangle to run. At the beginning, you need to configure a virtual environment, just follow the prompts, the following is a screenshot of mine (it seems to need keXue ShangWang).
insert image description here
The following is the author's running results:
insert image description here

Guess you like

Origin blog.csdn.net/Gou_Hailong/article/details/128242720