b3079db44e
Context: https://github.com/dotnet/android/issues/8381 Add a `DiagnosticSuppressor` to "turn off" the `IDE0002` style diagnostic message which incorrectly tells users to use the `_Microsoft.Android.Resource.Designer.ResourceConstant` type directly. This can cause allot of annoyance with our users because it appears on EVERY single usage of `Resource.*`. So you end up with what looks like code spagetti. So we need to start shipping an `Analyzer` assembly along with the `Ref` framework pack. This is the place these things need to go. Unfortunately it means that the older frameworks will not get this analyzer. Only the current one. On the packaging side, the Analyzer assembly has to go in a `analyzers/dotnet/<language>` folder in the .Ref Nuget Package. There also needs to be an entry in the `FrameworkList.xml` file which has a `Type="Analyzer" ` and a `Language="cs"`. This allows the IDE's to pickup the code. We can ship both regular Analyzers and the DiagnosticSuppressors in the same assembly. So we can extend this with more if needed. How this works is we use Rosyln to look for the IDE0002 diagnsotic message, we then check the code and see if it is refering to a `_Microsoft.Android.Resource.Designer.*` derived class. If it is , we add a suppression. This will stop the hint appearing in the IDE. I have tested this on VS in devbox and it appears to work . Also we generate a Resource Designer assembly and an Intermediate source file at build time. Both of these contain classes which should have the `GeneratedCode` Attribute. So lets add it. The version will be the same as the build assembly used to generate it. |
||
---|---|---|
.gdn | ||
.github | ||
.vscode | ||
Documentation | ||
Localize | ||
build-tools | ||
eng | ||
external | ||
samples | ||
src | ||
src-ThirdParty | ||
tests | ||
tools | ||
.editorconfig | ||
.external | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.lgtm.yml | ||
CODE-OF-CONDUCT.md | ||
Configuration.Override.props.in | ||
Configuration.props | ||
Directory.Build.props | ||
Directory.Build.targets | ||
LICENSE.TXT | ||
Makefile | ||
NuGet.config | ||
README.md | ||
SECURITY.md | ||
THIRD-PARTY-NOTICES.TXT | ||
Xamarin.Android-Tests.sln | ||
Xamarin.Android.BootstrapTasks.sln | ||
Xamarin.Android.Build.Tasks.sln | ||
Xamarin.Android.code-workspace | ||
Xamarin.Android.sln | ||
before.Xamarin.Android.sln.targets | ||
build.cmd | ||
build.sh | ||
dotnet-local.cmd | ||
dotnet-local.sh | ||
global.json | ||
msfinal.pub | ||
product.snk |
README.md
.NET for Android
.NET for Android provides open-source bindings of the Android SDK and tooling for use with .NET managed languages such as C#. This ships as an optional .NET workload for .NET 6+ that can be updated independently from .NET in order to respond to external dependency updates like new Android platform and tooling.
.NET for Android is part of .NET MAUI, and may also be used independently for native Android development using .NET.
Support
.NET for Android is part of .NET MAUI, since it was introduced in May 2022 as part of .NET 6, and is currently supported as described in the .NET MAUI Support Policy.
Support for Xamarin.Android ended on May 1, 2024 as per the Xamarin Support Policy:
Xamarin support ended on May 1, 2024 for all Xamarin SDKs including Xamarin.Forms. Android API 34 and Xcode 15 SDKs (iOS and iPadOS 17, macOS 14) are the final versions Xamarin targets from existing Xamarin SDKs (i.e. no new APIs are planned).
Follow the official upgrade guidance to bring your Xamarin applications to the latest version of .NET.
Downloads
.NET for Android ships as a workload through the dotnet
workload system in .NET 6+.
In its simplest form, .NET for Android can be installed by running:
dotnet workload install android
See the .NET workload documentation for additional installation commands and options.
While no longer supported, Classic Xamarin.Android installers are still available here.
Contributing
If you are interested in fixing issues and contributing directly to the code base, please see the following:
- How to build and run from source
- The development workflow, and using your build
- Coding Guidelines
- Submitting pull requests
Feedback
- Ask a question on Stack Overflow or Microsoft Q&A.
- Request a new feature or vote for popular feature requests on Microsoft Developer Community.
- File an issue in GitHub Issues.
- Discuss development and design on Discord.
License
Copyright (c) .NET Foundation Contributors. All rights reserved. Licensed under the MIT License.