在xamarin项目中使用android模块 [英] use android modules in xamarin project
问题描述
您如何在android xamarin项目中使用Maven或j-center Repository中的预制模块代码?
How do You use pre-built module codes from Maven or j-center Repositories in an android xamarin project?
更具体地说:
我想将此免费模块用作日期选择器:
I want to use this free module as a date picker :
https://github.com/alirezaafkar/SunDatePicker
我已阅读此页面:
https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-a-jar/
但是由于此模块不仅是jar
文件,所以我认为页面中介绍的方法将无用.
But since this module is not just a jar
file , I think the method explained in the page wont be useful.
推荐答案
只需在Android Studio中创建一个.aar库项目,将SunDatePicker添加为gradle依赖项并进行构建.然后创建一个Xamarin.Android绑定项目,将C#包装器放在.aar上.我一直都在做,效果很好.
Just create a .aar library project in Android Studio, add the SunDatePicker as a gradle dependency and build it. Then create a Xamarin.Android binding project to place a C# wrapper on the .aar. I do it all the time, works really well.
感谢SushiHangover.
Thanks to SushiHangover.
这篇关于在xamarin项目中使用android模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!