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

我们两清 提交于 2019-12-04 20:40:51

问题


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?


回答1:


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.




回答2:


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!



来源:https://stackoverflow.com/questions/12365504/is-it-possible-to-create-a-cross-platform-shared-library-with-monodroid-and-mono

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