Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 851
Geoffrey Avatar asked Jun 25 '13 07:06

Geoffrey


People also ask

Does Xamarin compile to native code?

Xamarin applications can be written on PC or Mac and compile into native application packages, such as an . apk file on Android, or an .

Is Xamarin better than native?

Though both Xamarin and React Native offer near-native performance, Xamarin runs the fastest code on Android and iOS and has a user interface (UI) for using native tools. TLDR: In Xamarin vs. React Native, Xamarin has more brownie points for native-like performance. Xamarin wins.

Is Xamarin truly native?

Technically speaking, Xamarin uses C# and native libraries wrapped in the . Net layer for cross-platform app development. Such applications are often compared to native for both iOS and Android mobile development platforms in terms of performance and user experience.

How Xamarin is used for native Android and iOS development?

Xamarin Forms enable fast prototyping with built-in UI libraries, adapted both to Android and iOS; Rich access to native APIs – just like in native apps, you can get access to the user's Bluetooth, camera, microphone. Features that use these API can be written in a specific language for faster performance.


2 Answers

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.

like image 77
miguel.de.icaza Avatar answered Oct 21 '22 12:10

miguel.de.icaza


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.

like image 36
Geoffrey Avatar answered Oct 21 '22 14:10

Geoffrey