Domanda

The idea is to share code between a desktop app using Mono and a dot42 app. So my question is: Is there any way to import a Portable Class Library or even a common library in a dot42 ? If not, is there any way to share code at all between them ? Thanks.

È stato utile?

Soluzione

A dot42 project is either a Visual Studio or SharpDevelop project. There is nothing preventing you to add a class library project to your solution consisting of the same C# source code that is used in your Mono project.

The .NET types are implemented on top of the Android API. For example, the .NET Dictionary class is implemented as a wrapper of java.util.Map and System.String as a wrapper of java.lang.String. In other words, we take the API from .NET but the implementation from Java. This is in contrast to Mono.

When you refer to .NET types and compile your dot42 project to an APK, the .NET types compile to a minimum amount of wrapper DEX code that invokes the Android framework. It therefore does not require an extra runtime and makes the APKs really small.

Here is the API reference of all .NET types that are currently supported (work in progress): http://docs.dot42.com/Reference/NS.System

We are working on adding support for Portable Class Libraries.

Disclosure: I work at dot42

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top