MonoDroid Progress

About 4 months ago, I worked on porting some of the Android SDK samples to run on MonoDroid. It was a soul-crushing failure. Every line of code I wrote exposed a new bug in MonoDroid which I had to wait until it got fixed to continue. Eventually I gave up on doing anything more than the absolutely trivial Hello World.

What a different story things are today!

I dusted off my unfinished Snake port, and it now works without modification.

Since I did it so long ago, there was no telling what magic I had in there to make it work on MonoDroid, so I ported another one from scratch. I grabbed the hardest sample I think they have: JetBoy. It's basically a fast-paced, Guitar Hero-esque game where you have to fire your laser to the music as each asteroid passes across the beat line.

After an afternoon of literal translation to C# (over 1k LOC), I fixed up the few Java porting issues like anonymous classes and nested classes accessing the parent class's private variables, and it *just worked*.

I think we're getting pretty close on finishing up our first release MonoDroid, and I can't wait to see what apps people write with it.

Both samples are available in our MonoDroid samples GitHub repository.


Justin said…
I cannot wait. This will make writing apps that support both Android and iOS so much easier.
Brian said…
JetBoy is indeed a nice translation. Nice work :)

Is it deemed to be "done" now?

I ask as, whilst it works, it doesn't start in the right orientation (tested from Windows), unlike the original Java version (tested on OS X).

The game should work in landscape orientation but the MonoDroid version stays in portrait.

Is this a known issue that is pending fixing?

- Brian
Brian said…

I played around and after going through the learning process of the manifest not really being there, I eventually spotted this missing from the activity attribute:

ScreenOrientation = Android.Content.PM.ScreenOrientation.Landscape

it's also missing this from the original:

Icon = "@drawable/icon"

Popular posts from this blog

Hack Week 3

Mono in Visual Studio 2010

Introducing Pinta