C# .dll library in Android app

后端 未结 1 1127
生来不讨喜
生来不讨喜 2021-01-02 09:33

I\'m currently using Monodroid to develop an android app. I\'m rather new to phone apps so am confused over a couple things:

  1. What by definition is an androi

相关标签:
1条回答
  • 2021-01-02 09:44
    1. The DLL generated is compiled against the Mono for Android profile, which is based on Moonlight (Mono's implementation of Silverlight). At runtime, .NET code is run directly against the Mono runtime which runs as part of your application. When .NET code subclasses something from the Java side (e.g. Java.Lang.Object), Mono for Android generates callable wrappers to handle communication between runtimes.
    2. Technically you can use a normal .NET DLL in your Mono for Android application, but I wouldn't recommend it. The profile exposed by Mono for Android is much smaller than that of the full .NET framework (and isn't even completely equivalent to that of Silverlight), so if your DLL references a method that isn't found in Mono for Android, your application will crash. Instead, I would recommend creating a separate class library for your application, and share source files across projects using file linking. My blog post here contains an example of how to do that.
    0 讨论(0)
提交回复
热议问题