Is it possible to embed xamarin part into an existing native app?

喜夏-厌秋 提交于 2019-12-30 22:27:26

问题


I have existing iOS and Android native apps. Is it possible to extend the apps with Xamarin coded part ?


回答1:


Both Xamarin.iOS and Xamarin.Android are currently setup to take control of your application, so you need to make your main program be written in C# and then call into the existing code.

The way that you would do this is to bind your existing Objective-C or Java code as C# libraries, and then consume those libraries from C#. The binding technology is precisely what drives both the Xamarin.iOS and Xamarin.Android tools, so you would effectively be doing the same.

Once you have bindings, the interoperability works both ways: you can call native code, and native code can call C#.

The bad news is that instead of starting to enjoy writing code with both tools from day zero, the first thing you have to do the bindings, which is in general, not as fun as watching colored squared move on your screen.




回答2:


Ok I find an answer here : http://www.whitneyland.com/2013/05/why-i-dont-recommend-xamarin-for-mobile-development.html

For example, code written in Xamarin cannot be used in native or HTML5 apps.



来源:https://stackoverflow.com/questions/17291676/is-it-possible-to-embed-xamarin-part-into-an-existing-native-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!