
目前,我们正在开发一个.NET标准类库,将由不同的Xamarin.*平台使用.
我想知道是否有一种方法可以在原生Android项目中使用共享代码(可能会生成AAR / JAR文件).
我需要这个功能的原因是因为我们的公司为我们的一个客户提供了一个AAR(由本机AndroID项目使用),我们希望保留一个源代码而不是两个.
提前致谢!
解决方法:
更新:
名称已更改为“.NET嵌入”,此更新时位于v0.4.
> https://developer.xamarin.com/releases/dotnetembedding/dotnetembedding_0/dotnetembedding_0.4/
新说明:
> Installing .NET Embedding
原帖:
你可以使用Mono的Embeddinator-4000
It supports varIoUs language consumers, so it surfaces .NET code as idiomatic code in the target language. This is the List of supported languages at present:
> Objective-C:将.NET映射到惯用的Objective-C API.
> Java:将.NET映射到惯用Java API.
> C:将.NET映射到面向对象的C API.
Embeddinator-4000 is a tool that allows your existing .NET Code (C#, F# and others) to be consumed from other programming languages and in varIoUs different environments.
Java is currently in a prevIEw state for macOS, windows, and AndroID.
The platform is selected by passing the –platform= command-line argument to the embeddinator. Currently macOS, windows, and AndroID are supported.
回复:https://mono.github.io/Embeddinator-4000/
作为AndroID要求的一部分,您将需要Xamarin.AndroID 7.4.99和AndroID Studio 3(Java 1.8),但如果您使用Xamarin和Java构建AndroID应用程序,那么您将拥有这些应用程序.
注意:此工具处于预览状态,因此请查看未解决的问题并在需要时发布新问题.
回复:https://github.com/mono/Embeddinator-4000/issues
注意:这不是反编译,而是将Mono的运行时嵌入到允许CIL代码,AOT(即iOS)或不在不同语言/运行时内运行的本机包中.
总结以上是内存溢出为你收集整理的android – 将.NET标准类库转换为本机aar / jar全部内容,希望文章能够帮你解决android – 将.NET标准类库转换为本机aar / jar所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)