Active Topics

 


Reply
Thread Tools
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#1
(Revised 3/22) For free c# programming ebook (pdf) click here

Here's the quick howto for setting up Mono 'compile-on-device' for OS2008/7 (not sure about 2006)

Step 1 :
Add mono repo : (name 'Mono', web address 'http://go-mono.com/maemo', distribution 'bora', components 'user')
Install mono-runtime and publicly-available mono libraries (this first iteration uses 1.0 libaries)
- Install mono-runtime
- Install gtk-sharp2
- Install libmono-system1.0-cil
- Optional grab all the other mono libs since they take up so little space
(close app manager)

Step 2 :
Install my deb of mono pkg-config files (needed for 'linking' against libs) :
http://wardenclyffetower.com/MaemoFi...-1.2.5.all.deb

Step 3 :
Install my deb of the mono compilers (since not available from mono maemo repo) :
http://wardenclyffetower.com/MaemoFi...-1.9.0.all.deb

Step 4 :
Enable red pill mode in the App Manager and then install this (pkg-config utility) :
http://wardenclyffetower.com/MaemoFi....2-1_armel.deb
Now go back into blue pill mode in app manager... and your done.

You can now natively compile mono gtk apps on device.

Step 5 :
Underneath your home directory create a new directory to work in.
Create hello.cs file there containing :
Code:
using System;

namespace CSharpFriends
{
    class Class1
    {
        /// 
        /// The main entry point for the application.
        ///     
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World");    
        }
    }
}
Then compile it with mcs hello.cs and run it with mono hello.exe.


If you use namespaces in other assemblies, make sure you not only include the namespace but add the package to the compile command line.

For example a gtk/glade application will need to be compiled with :
mcs myappname.cs -pkg:gtk-sharp-2.0 -pkg:glade-sharp-2.0

Last edited by pipeline; 2008-04-06 at 23:31.
 

The Following 9 Users Say Thank You to pipeline For This Useful Post:
Posts: 19 | Thanked: 6 times | Joined on Oct 2007
#2
Hi,

I went through the steps but when I try to compile, I get the following:

Package gtk-sharp-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing 'gtk-sharp-2.0.pc' to the PKG_CONFIG_PATH environment variable.
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#3
My mistake the directory to copy to in step 3 is /usr/lib/pkgconfig.

Can you place those step 3 files there, verifying gtk-sharp-2.0.pc file is one of them, and try again.

BTW Glade rocks with this setup But thats a separate lib/pc file to include on compile line.
 

The Following User Says Thank You to pipeline For This Useful Post:
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#4
I have written a sample program which i actually needed. It's only half-designed to be a sample and the other half complex network and parsing for real world application.

Its a program which (every 5 minutes) will check for new email on a pop email server and if you have new mail it will launch flite (separate speech synthesis program) to announce their 'From' and 'Subject' lines.

So you will need flite installed, and the mono, gtksharp, and pretty much install all the 1.0 libraries.

You also need to edit the glade file and set the default text of server, username, and password GtkEntry controls to your pop mail server settings.

It demonstates glade, launching processes, timers, string parsing/manipulation, and network streams (more advanced)

This sample used information from :
- This sample : http://www.codeproject.com/KB/IP/popapp.aspx
- This tutorial : http://nat.org/demos/gtksharp.html (<- Highly Recommend watching this!)

To rework (with help from flite) into this sample.

I've put up the source files (along with exe for those that just want to run it without compile) here :
http://wardenclyffetower.com/MaemoFiles/mono/samples/

(grab either tar or zip ... they are the same)

To compile :
mcs popmail-announcer.cs -pkg:gtk-sharp-2.0 -pkg:glade-sharp-2.0

To run :
mono popmail-announcer.exe
Attached Images
 

Last edited by pipeline; 2008-03-23 at 00:36.
 

The Following User Says Thank You to pipeline For This Useful Post:
Posts: 53 | Thanked: 44 times | Joined on Feb 2008
#5
Very much cool! Since this appears to be one of about next to zero sources of information about Mono on Maemo on the net - is there documentation anywhere on maemo-sharp?
 

The Following User Says Thank You to psykosis For This Useful Post:
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#6
I haven't looked into maemo-sharp since the library version in the repo is bindings for maemo 2.2 (os2006). For most tasks that library is not needed and reduces portability, but that doesn't answer your question. I havent found an api for that lib and am not sure it would still be applicable on os 2008.

I'm trying to get/build newer libs to work and find out what plans the maintainer (Everaldo Canuto) has for releasing new builds. I'll pass on any info i get on that or you can check his blog here :
http://ecanuto.blogspot.com/
 
Posts: 53 | Thanked: 44 times | Joined on Feb 2008
#7
Actually, Pipeline, I think you answered the question better than supplying the API - since I am also running OS2008 and I agree, it is doubtful that is overly useful to us.

Hopefully there will be more movement on porting Mono to OS2008 in it's entirety. In my searches, it seems someone was working on compiling the GDI libs, which I believe is our lacking as far as utilizing winforms.
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#8
Update on mono developments :

Mono 1.9 libraries are currently in test and they look look really good.

They fixed my serialization and iterator issues and in general it looks very capable.

Additionally i am testing hacking together mono xsp server. Mono XSP is lightweight ASP.net server. I am still researching this and copying the files manually (they are all managed code libraries/executables... not maemo/arm specific).

Its too soon to say but there could possibly be winforms.

So things look like they are shaping up for nice 1.9 release. If you are willing to provide everaldo some feedback, drop him a message. If you just want to test out these unofficial 1.9 builds, p.m. me for repo info.
 

The Following User Says Thank You to pipeline For This Useful Post:
Posts: 157 | Thanked: 16 times | Joined on Jan 2008
#9
This is slightly offtopic but, is there vb.net support for the current version of mono for maemo or at least planned support for it?
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#10
Ok well the runtime (which is what they distribute in repos) includes no compilers at all (at least officially at the moment).

But compilers are managed code... meaning the work the same on x86/Macs/or even ARM linux devices... they just need relevant system runtime and libraries. So i pretty much grabbed the c# (mcs and gmcs) compilers (.exe's) from an actual mono x86 installation or devkit. Additionally there are msbuild libraries and webserver libraries (System.Web)... all waiting to be enabled on arm maemo I could use help though... but with 1.9 this looks like alot of potential.

So i'd guess you could use mono's Vbnc.exe compiler to compile against the 2.0 framework (no vb support for 1.0) but you probably wouldnt have visual basic specific namespaces (libraries). I'll test it out later but you probably grab out of a real mono installation.

Libararies are probably managed code though so once i figure out (or stumble onto) proper way to install them to gac, then probably any existing mono library including mono vb specific libraries can be added. So (I think) even old assemblies you may have built years ago on windows could be copied an run on maemo if they themselves use only namespaces which are in repo or hacked onto device.

Last edited by pipeline; 2008-03-21 at 11:51.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:25.