Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create a cross-platform shared library with MonoDroid and MonoTouch that can be used by non-Mono developers?

We have a proprietary piece of hardware which we are looking to release as a phone peripheral.

We have started writing a cross-platform mobile app that interfaces with the hardware using the MonoCross framework (i.e. MonoTouch abstraction layer for iOS and MonoDroid abstraction for Android).

We would like to offer the bulk of this application as a code library that can be reused by other app developers who wish to write apps that interface to our hardware.

I am concerned that by using Mono we are forcing these developers to do the same. Is that the case?

Android Library

Can we produce an Android Library (not a Library Project which I understand to mean delivering the full-source) as output from MonoDroid that other developers, developing with the ADT and Java (i.e. they are not using Mono Droid) are able to use in their apps?

iOS Library

Can we produce a library from MonoTouch that Objective C developers (i.e. they are not using Mono Touch) are able to use in their apps?

like image 612
Adrian Hope-Bailie Avatar asked Sep 11 '12 08:09

Adrian Hope-Bailie


2 Answers

The answer is no for both cases, it is not possible to create managed libraries that non-managed apps can use, neither on MonoTouch nor or Mono for Android.

This is because the managed libraries depend heavily on the managed runtime, they're not standalone libraries.

like image 88
Rolf Bjarne Kvinge Avatar answered Oct 31 '22 11:10

Rolf Bjarne Kvinge


I have the exact same question as you actually ... On iOS, from what I was able to gather from Xamarin, it's possible but not supported.Though, I am still waiting for an example :/

From what I understood, monodevelop is able to compile a native ARM library that can be used by an objectiveC source by doing something like that :

/Developer/MonoTouch/usr/bin/mtouch --linksdkonly --xcode=output_dir MyAssembly.exe

In your XCode project,it seems that you need to use the Mono-Embedding-API.

http://docs.go-mono.com/?link=root:/embed

It would be nice if xamarin could provide a source example because it's a highly needed feature for a toolkit like this!

like image 2
Vincent Bellet Avatar answered Oct 31 '22 12:10

Vincent Bellet