Mono

From OLPC
Revision as of 18:23, 27 December 2007 by Mk8 (talk | contribs)
Jump to: navigation, search
This article is a stub. You can help the OLPC project by expanding it.

Sugar activities are usually written in Python using the Python Activity API. This page documents how it is possible to use Mono to write a Sugar activity. With Mono, you can use any underlying language like C# or Boo.

Overview

XO Bundle and Mono Bundle

To write an OLPC Mono activity, you need to prepare a .xo Bundle including all required libraries. This is necessary because the Mono runtime is not officially supported by the OS images.

If you use mono, you know that the compiler not traslate the source code to the assembly language, but in IL (Intermediate Language) that need a runtime to be run. Since you don't have the runtime installed on the XO, you need to create a mono bundle so all the runtime is packed in one executable.

To do this you need to have the program already in binary format and use the mkbundle2 utility to create the stand-alone application.

mkbundle2 --config /etc/mono/config --deps --static -o MonkeysMemory.exe monkeysmemory.exe Sugar_0.0.1.dll NDesk.DBus.GLib.dll NDesk.DBus.dll

Normally the use of --static flag normally have some licence restiction, but here can be use without limitation.

How to run a Mono activity

You can find a sample activity written using Mono.

Interface with the native subsystem

Create new application

Sugarize existing application

More documentation will be released as soon as possible.