[mono-android] Android callable wrapper - adding dll to java project

Jonathan Pryor jonp at xamarin.com
Thu Jun 28 20:06:09 UTC 2012


On Jun 27, 2012, at 2:09 AM, Varun Kumar G wrote:
> I have created a mono android library. And now I need to port  that library of c# to java project.

So that we're on the same page, "port" normally means to translate into another language. I don't think you're trying to port your C# library to Java; I think you want to use your C# library from Java.

You will hit a major problem: Mono for Android was designed to easily consume Java. It was not designed to make things easily consumed from Java. It should (in theory) be possible; it just won't be easy:

	http://lists.ximian.com/pipermail/monodroid/2011-December/007690.html

(Some things have changed, such as the addition of [Export] in 4.2.0 means that ACW's can have ~arbitrary methods exposed, but the bootstrap problem outlined in that message is still present.)

For sanity purposes, I would instead suggest that your Eclipse/Ant project generate .jar files which you then consume from your Mono for Android project. Your Eclipse project can still use Android resources, and they'll be merged into the Mono for Android app.

 - Jon



More information about the Monodroid mailing list