I've been playing with MonoTouch a bit of late, mostly as I wanted to learn CocoaTouch (the iPhone apis), but try and seperate myself from the language (Objective-C) vrs just how the API holds together.** On The Telly** is the result.
Update: BBC changed how their download interface works, so this may not work any more. Paul has more info here. It might still work, being it's running on an i-Device, so the certificates are available, but I've not tried it.
Update: I've moved the code here. Fork it etc as you want.
What is it?
On The Telly is a iPhone application which allows for offline viewing of BBC iPlayer content on the iPhone. iPlayer serves a h.264 stream to the iPhone, however this only works streaming over WiFi, so it's not a lot of use if you are on a train or the tube. iPlayer does support offline viewing on other devices, but they must support DRM. As you can't get the h.264 files off the iPhone, this is sort of redundant.
For those in the US, substitute "iPlayer" for "Hulu" - same idea, different country.
The source code for this is below. It's really only of use to you if you want to see how it works (which is the point) as Apple prevents it being in the appstore (good old clause 3.3.1), and BBC does not license it's content for non-personal use. But it was fun to write, and might serve as guidance for someone else building either a MonoTouch application, or even a "normal" iPhone application if they are coming from a .NET background.
**Side rant: **On Clause 3.3.1, I'd challenge anyone to tell the difference between this and an Objective-C-coded application except that the file size of the app is around 2meg, and if done in Objective-C it would be around 1meg, as a MonoTouch application has to include some of the Mono framework, which can't be excluded by the compiler. Other than that, this is a non-cross platform, native iPhone app. If you know Objective-C, you'll be able to follow allow in the code, because it's mostly syntacticly different, not functionally. The objects created and used - UIButton, UITableViewController et al - are the same as an Objective-C app would use (not even mappings or intermediate layers - the same classes and code).
Of course, if Apple keep clause 3.3.1 in as they have it now, at least I'll not lose any skills I've learned doing this.
Anyone who says it's about multitasking is full of shit, and has not seen the APIs for multitasking. It's about Adobe, pure and simple.
Anyway, back to the app!
The application consists of a number of tabs:
The download tab. This contains the shows which have been downloaded.
The queue tab. This has shows which have been queued for downloading
The Features tab. This shows the featured and highlighted shows on iPlayer
News and other category tabs. These show the shows in each category.
BBC limit iPlayer to disallow downloads from outside the UK, or over 3G. The app will most likely crash if you try, or say content is not available. Dont ask why you can't download a specific show if you are on 3G (in the UK) or anywhere outside of the UK.
Feedback so far has been positive, but none of it has been from the BBC. Oh, well. It was fun to write.
Here is the source code. It needs various things in order to run:
MonoTouch 2.x. You can use the trial version, but only in the iPhone simulator.
A Mac and an iPhone development license from apple, especially if you want to put it on a device. Duh. Just the Mac if you want to run in the simulator.
I think the application has good examples of:
Background processing, keeping work off the main (UI) thread
Database access (sqlite) on the iPhone
Using WebClient to download content
Image manipulation on the iPhone
What can be done in around 20 hours work using MonoTouch. This was not a complex app to write, thanks to Paul's work on how to download the shows, in Ruby, and tools like Linq to XML and MonoTouch.
Overall, I found MonoTouch and MonoDevelop lovely to use - except I'd love to have ReSharper available for MonoDevelop. Using .NET without ReSharper is always a little painful, even if I'm using Visual Studio!