Wednesday 30 December 2009

Audio Book Organiser (AIR, Mate, Flex 4)

Well its been a fun Christmas, I have eaten and drunk to the point that im going to be running it off in the gym till next christmas.

Although there has been merryment abound, the keyboard couldn't keep me away. Its probably okay to say this now as im not under any secrecy act; I have decided to leave Massively Multimedia in Manchester to join a new startup called Ideas Pad in Wilmslow (just south of Manchester).

I cant say too much about exactly what I will be working on just yet but I can say that it will involve my experience in the Flash world. Specifically, I will be working in Adobe Flex again on some fairly sizeable projects. For this reason I wanted to brush up on my Flex as there has been a new release of the IDE (now named Flash Builder) and the SDK.

In addition I wanted to look at the various frameworks in use for Flex these days. I have used the usual Cairngorm, PureMVC before however I stumbled accross a new one called Mate (pronounced mah-tay, like the drink). Mate looked very interesting to me so before I jumped two feet in and used it in a commercial project I wanted to give it a spin in a simple project first.

Finally we get to the point of this post. I have developed a simple Adobe AIR application that allows you to organise audio books. The basic idea is simple you give the application a selection of 'source' directories where your audiobooks belong then you can tick off whether you have listened to each one, and what rating you would give them.

ScreenHunter_02 Dec. 30 12.32ScreenHunter_03 Dec. 30 12.32



The data is persisted to a file that is saved to your hard drive, so when you open the application up again next time it remembers which audio books you have listened to and what ratings you gave them.

I havent tested it very much atall so there is a very high likelyhood of being some strange bugs in there. I am also releasing all the source code for this project for all to see, use and study if they so wish.

[airbadge]Audio Book Orgainser,http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser.air,1,http://www.mikecann.co.uk/flash/AudioBookOrganiser/badgeImg.jpg[/airbadge]




Source: http://www.mikecann.co.uk/flash/AudioBookOrganiser/AudioBookOrganiser_v101_source.zip

Wednesday 23 December 2009

Kitten vs Spam

Well im back from Germany and after a horrendous journey involving stolen passports, lost luggage, cancelled flights, 11 hour waits in airports and 9 hour bus journeys I needed something to cheer me up. This fit the bill nicely:

Monday 14 December 2009

The New Bike

Well after the thieving of my bike a few weeks ago I was offered a new bike as replacement by the insurance company, a Kona Shred, another dirt bike.

And here it is:

photo

Doesnt it look mean?

I dont really need a dirt bike  as im not exactly going off road in the centre of Manchester so I had a half-hearted go of selling it on ebay.

In the end I have decided that ill keep it as it is very shiney and im abit of a magpie :)

Sunday 13 December 2009

Flirting With JavaFX

For the past several months I have been working on a little project completely different to anything I have done before. Its a desktop application that uses a number of novel technologies to do something I think is pretty cool. Ill talk more about what it actually is and does in the coming weeks, but for this post I just want to talk about the struggles and discoveries I have been through and made with the technology.

One of the basic tenants of the app is that it needs to work  cross-platform, so on mac, windows, linux, etc. As my previous experience with any sort of cross-platform coding involves using Java that was my natural first choice.

It has been a while since I have coding anything substantial in Java, infact my university project Chain Reaction was my last serious foray into the language:



I knew that I wanted a nice rich interface for the project as it was intended to be sold to non-technical users. My first choice with Java was naturally with Swing. This, however, soon brought back various memories of 'JPanels', 'Layouts' and 'Look and Feels'  and the headaches of trying to make simple things look attractive (tho some cool advances have been made with substance look and feel).

After having worked for years with Flash / Flex I had grown used to the ease of drawing graphics and manipulating Display Objects in the display hierarchy. I was dismayed at how difficult it was to do what I considered 'simple graphic tasks' using Java!  A simple google search for the terms "Java 2d graphics" demonstrates how old some of the concepts and documentation is on the subject.

I ended up writing and rewriting my view using different libraries like G:

ScreenHunter_03 Dec. 13 20.05

I found them all to be unwieldy and too inflexible for what I had in-mind. It all just seemed so archaic and old-hat.

So I was becoming more and more frustrated with myself for not progressing with the project and becoming hung up on something I had taken for granted in the Flash world. It was then that I happened to stumble across (this is after weeks of struggling) the JavaFX project. Now I had heard about this many months back but had dismissed it as Suns rather lame attempt to steal some of Adobe's dominance of the Flash player market (much like Microsoft's attempt with Silverlight).

As I was at the end of my line with Java I thought, hell why not give it a little look. Well it took me by surprise. It turns out that JavaFX is rather neat!

For those who havent heard f JavaFX; taken from Wikipeda:
javafx_logo_color_1JavaFX is a software platform for creating and delivering rich Internet applications that can run across a wide variety of connected devices. The current release (JavaFX 1.2, June 2009) enables building applications for desktop, browser and mobile phones.

TV set-top boxes, gaming consoles, Blu-ray players and other platforms are planned.JavaFX is fully integrated with the Java Runtime Environment (JRE) – JavaFX applications will run on any desktop and browser that runs the JRE and on top of mobile phones running Java ME.

What this means is that you can (with a little jiggery pokery) use JavaFX with normal Java. This is great as I had already written a whole load of code in Java which I didn't want to get rid of.

The language JavaFX Script is great. It took a little getting used to as it is a declarative language (much like Flex's MXML except that instead of using XML as the language it uses a Java Script like notation) but once I was used to it I could immediately see the awesome power it brings.

A little sample of code to give you a feel of how its declarative approach works:
Stage {
    title: "Ello World"
    width: 300
    height: 300

    scene: Scene {
        content: [
             Text {
               font: Font { size: 22 }
               x: 20, y: 90
               textAlignment: TextAlignment.CENTER
               content:"Ello World!"
             }
        ]
     }
}

This is your standard "Hello World" (but with a British twist):

ScreenHunter_06 Dec. 13 20.32

The simplicity of rendering things to the screen was just what I was looking for as the for this project, it was a double bonus that the language is powerful.

I love some of the features of the language like the natively build in binding, the sequence manipulations, but Ill talk more about some of these features in another post as I have rambled enough in this one as it is.

For now however, if you want to do some more reading into JavaFX  I HIGHLY  this short set of tutorials: Learning the JavaFX Programming Language - Tutorial


avaFX is a software platform for creating and delivering rich Internet applications that can run across a wide variety of connected devices. The current release (JavaFX 1.2, June 2009) enables building applications for desktop, browser and mobile phones. TV set-top boxes, gaming consoles, Blu-ray players and other platforms are planned.

JavaFX is fully integrated with the Java Runtime Environment (JRE) – JavaFX applications will run on any desktop and browser that runs the JRE and on top of mobile phones running Java ME.

JavaFX is a software platform for creating and delivering rich Internet applications that can run across a wide variety of connected devices. The current release (JavaFX 1.2, June 2009) enables building applications for desktop, browser and mobile phones. TV set-top boxes, gaming consoles, Blu-ray players and other platforms are planned.

JavaFX is fully integrated with the Java Runtime Environment (JRE) – JavaFX applications will run on any desktop and browser that runs the JRE and on top of mobile phones running Java ME.

Thursday 10 December 2009

The Case of The Transitional Doctype

I took a little break from my 'top secret' project (more on this coming soon) this evening to do some much needed repair work on one of my flash games portals www.worldsbestflashgames.com.

Top of my list was the fact that the index page doesn't render correctly in IE7. What makes it odd is the fact that the category pages which are essentially identical to the index page rendered fine.This is what it looked like:

ScreenHunter_01 Dec. 10 19.28

Normally when you hear that there is an issue with a site on IE and not on FF or other browsers you automatically assume its CSS, and so did I. After stripping the site down to its bear bones however, comparing the index page against the category page I will still getting this oddness.

To cut a long story short I worked my way up from the bottom of the page to the top until I reaced the very top line:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

This line was the only line that differed in the index to the category page, which read:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

So I took out the "Transitional" and low and behold it worked!

ScreenHunter_02 Dec. 10 19.41

No idea what Transitional does, but I hope this helps someone else out in the future!

Friday 4 December 2009

BlastWave: Lost at Sea

FINALLY ITS LIVE!!!! Oh my, it has taken literally months and months to get all the deals sorted but finally now its done and out.

Its Oliver and my latest game. It was supposed to be a quick re-skin of BlastWave, but as usual "quick" was a word that got lost during development as we got excited about it and decided to add more and more features.

The Art by Oliver Pitceathly follows a simmilar style to MonkeyMines. Hope you like it!