[Mono-list] Package Importieren
Jonathan Pryor
jonpryor at vt.edu
Fri Sep 9 15:59:10 EDT 2011
On Sep 8, 2011, at 3:58 AM, Kuehner wrote:
> So, to the very beginning question: How can I implement a *.java-File into a
> Mono .NET Projekt for Android?
You can add it to the project, and set its build action to AndroidJavaSource. (This can also be done with .jar files.) This will cause the .java/.jar file to be included in the final .apk.
> I tried it with ikvmc without the standard libraries (using Mono-Libraries),
> but... well... for someone who's familiar with Java and Linux and Mono maybe
> obvious that this does not work, because *IKVM.OpenJDK.Core * needs another
> System.dll:
Mono for Android (and MonoTouch) use a different "profile" which is closer to Silverlight than desktop .NET. As such, many types and members are missing (e.g. System.Configuration, System.CodeDom, etc.), so you can't use a pre-compiled assembly that references a "normal" System.dll and use it with Mono for Android. Instead, you need to recompile the source against the Mono for Android profile assemblies; in this case, you'd need to recompile IKVM.OpenJDK.Core.*. I don't know how easy this would be.
I'm also not sure how advisable it would be, either; iirc the IKVM.OpenJDK.Core.dll assembly is 4.1M in size, and would amount to a second Java VM within the process...
- Jon
More information about the Mono-list
mailing list