dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 531 forks source link

aar app export? #6108

Open jonpryor opened 3 years ago

jonpryor commented 3 years ago

Context: https://developercommunity.visualstudio.com/t/C-library-integration-in-android/1445867

A customer would like to be able to "include" the contents of a Xamarin.Android app into an Android app, kinda/sorta like what https://github.com/mono/embeddinator-4000 was trying to support.

Supporting ".aar export" at the level of a library would be complicated.

Supporting ".aar export" at the level of an app should be "reasonably" straightforward (famous last words), in that it should be possible to emit a .aar that contains all (linked!) assemblies and native libraries and resources (oh my!), along with AndroidManifest.xml.

This would not permit creating a .aar and distributing it on e.g. Maven (there'd be duplicate mscorlib.dll files, duplicate libmonosgen-2.0.so files, etc., etc.). It would allow easier use of C# in more contexts than is currently supported.

jonpryor commented 3 years ago

.aar contents: https://developer.android.com/studio/projects/android-library#aar-contents

.aar files can't have assemblies as a top-level entry, so assemblies would need to be moved to e.g. assets/.net/assemblies, similar to what was done in Embeddinator-4000.

AlexSchuetz commented 2 years ago

I have some some business-logic written in C# (netstandard2.0) that is used in various szenarios (xamarin-forms, unity, avalonia and ASP-NETcore). The main goal was to make this logic available to as much platforms as possible without duplication written in a high-level OO-language.

Next and final step would be to make the library available for native android (and ios) applications as well.

I'd like to work on this issue, but I have no clue where to start. Any hints?

llzz19851985 commented 1 year ago

Is there a development plan for this feature?I hava a project need this feature too!

soma9017 commented 5 months ago

@llzz19851985 anyway to use the c# dll to use in native android application developments..? if yes please explain how to achieve this as i am also looking for something like this