The .NET 6 team has done another step in the direction of uniforming the processes and tools of writing code for different platforms. Now it is possible to install the stack to compile applications for Android and work with it only via dotnet cli.

# Why

Developing cross-platform mobile apps can be done with a large variety of frameworks and tools, but, for native applications (or close-to-native performance), the selection is limited. Xamarin is one of the frameworks that is considered native, and it has evolved a lot over time to stay updated with the latest improvements and features of the mobile OSes.

Up until recently, Xamarin could only be developed with ease in the Visual Studio IDE. The downside is that someone might consider it limiting when it comes to license. On the other hand, VS Code is more widely used by a large group of developers.

The latest version of .NET 6 brought Xamarin inside the dotnet tooling in the form of workload and it’s now possible to get a fully functional development environment, that requires only the dotnet SDK.

# What changes

Now it is possible to target Android in a C# project file using the standard SDK project. Here is an example file:

# VS Code setup

2. Install dotnet SDK
4. Open the sample project
5. Install the extensions
6. Start the emulator from the task

# Running

2. Select the target Run
Another area with huge improvements is binding libraries. Just change <OutputType>Library</OutputType> and add the jar or aar. Add Metadata.xml if needed. That’s it.