Google Android Development Agency SASS

Thursday 21 May 2009

Editing Umbraco in canvas mode gives error

I hit a slight quirk with Umbraco today. One of the features of Umbraco is its ability to edit a page in "Canvas mode". This means your page opens in a new window and is rendered as if it was a website, but with a content editor for you to edit your content in; much nicer than using that small white editor.

Today I fired up the canvas editor for one of the pages in a new site I'm working on, only to be met with:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Hmmf. It's because in the footer of the website I'm doing:

<%=DateTime.Now.Year%>

To output the current year. Umbraco is attempting to modify the controls collection of the page to create the editor, which is not allowed when using inline code blocks.

The workaround is a bit sneaky, but simple. All you need to do is change to the databinding syntax for echoing, like this:

<%# DateTime.Now.Year %>

Now all is well, the control collection can be modified and you can bask in the glory of the Umbraco canvas editor.

Tuesday 19 May 2009

MIDI Playback in Android Cupcake

If, like me, you've been wondering why the audio support in Android was so poor, you'll be pleased to hear that Android 1.5 (Cupcake) addresses some of the issues.

I'll write a more in-depth post once I've gone through some real world examples, but one thing which I'm currently reading up on is the in-built MIDI support.

Rather than just stick a bog-standard MIDI engine in Android, the Google engineers have chosen to include a JET playback engine, which allows musical synchronisation of clips and seamless playback. It's mainly tailored towards game playing as it allows you to script the clips about to played back to tie in with the gameplay, but I'm already thinking up some cool musical ideas for it.

Have a read of the documentation on Android.com, at http://developer.android.com/guide/topics/media/jet/jetcreator_manual.html

New Tub Thumper Version

Today we released a minor update of our Google Android application Tub Thumper.

Tub Thumper is a touch screen drum machine for the Google Android platform and has proved immensely popular since its release last November.

This version is a minor release with a new hip-hop style drum kit, to wet people's apetites for our upcoming major release.

We've been hard at work developing Tub Thumper Pro, which will feature many new cool things. Notable assignable drum pads and the ability to sequence beats, similar to using a Roland TR-909 drum machine.

As it's not yet ready I'm not saying much more, but here's a sneak preview of assigning some drum sounds:



We're aiming this release for the Cupcake build of Android, which will have hit everyone's phones by the time we release it.

At SASS, we spend most of our time working on client projects; developing web and mobile applications for clients. It's nice to get a break from this to work on some of our own projects such as Tub Thumper and it gives us a great opportunity to try out new development ideas and increase our knowledge as developers. There does not seem to be a huge amount of Android developers around Manchester and Cheshire so it often feels like we're out on our own, but we'll continue to experiment and release new Android apps to showcase our ideas.

You can grab Tub Thumper from the Android Market. Just search, or check out the most popular Multimedia apps.

Friday 8 May 2009

Changing the color of the iPhone navcontroller bar

You may have noticed some apps on the iPhone have different colored navigation bars. I didn't have any reason to play with this, but being an inquisitive iPhone developer I wanted to know how it's done. I hadn't even noticed that you could customise this in Interface Builder, but it turns out it's really simple.

Just open up your root view controller (MainWindow.xib) in interface builder. Now click on the NavController icon:



Now open up your inspector panel and look at the Top Bar drop down. You can select the color of the Nav Controller bar there, set it as either Normal (blue grey), Black or Translucent.



Now you can have a cool black nav controller too!

Thursday 7 May 2009

UK G1 Owners - Get Android Cupcake early!

The rumour mill has been in full swing with regards to the early push out of Android 1.5 "Cupcake" to UK T-Mobile G1 users. Whether or not they really have started the push remains to be seen (I've not had it) but the folks over at Andblogs.net have posted how you can get it early.

First things first, grab the update: UK 1.5 Cupcake Update (CRB17) (5)


Save it to the sd card, named “update.zip”. (If you use windows, be sure you aren’t naming it something like “update.zip.zip”.) Reboot your phone in recovery mode (hold down ‘home’ while booting until you see the diamond warning.)


Now time to update! Press Alt-L. (This will turn on logging, so you can see what is going on.) Then Alt-S will apply the update.zip from the sd card. When it finishes, it’ll reboot.



I'm just trying, fingers crossed!

Oh, and don't blame me if you brick your phone, like I said - I've not tried it yet! Don't know if this works for countries other than the UK either, I'd suspect not but feel free to comment if you know otherwise.

Update!



My phone exploded in a huge fireball! Just kidding, after a nerve wracking few reboots with some cryptic logos I finally got a shiny new animating silver Android logo and I'm now smothered in delicious Cupcake.

Here are a couple of money shots:

The much-talked about touchscreen keyboard.


New homescreen icons (and check out my sweet (get it?) NIN Downward Spiral wallpaper, in your face iPhone!):


In the inimitable words of fake James Hetfield, sprinkles GOOD!

Wednesday 6 May 2009

iPhone GPS programming is easy

Before I looked at GPS development for iPhone I was bracing myself for an onslaught of complicated hardware commands, old school C data structures and binary arithmetic. Queue a flashback to the CoreAudio learning curve...

Almost unbelievable it's not the case though; Apple have made things pretty straightforward for a change!

The first thing to do, and the key to it all, is to create a class which conforms to the CLLocationManagerDelegate specification:


@interface MyLocationManager : NSObject <CLLocationManagerDelegate> ...


The CLLocationManager delegate needs to contain a method which is called to notify it that the location has been updated. Basically, this:


- (void) locationManager:(CLLocationManager *) manager
didUpdateToLocation:(CLLocation *) newLocation
fromLocation:(CLLocation *) oldLocation {
...


Now within your method implementation you can access the coordinates of the old and new locations with:


newLocation.coordinate.latitude;
newLocation.coordinate.longitude;
newLocation.altitude;


Obviously you'll need to do a bit of jiggery pokery to get those raw figures into a useful state, but that's down to your own app logic. In terms of getting the GPS coordinates nothing could be easier!

Apple have a very good sample project in the developer library called LocateMe. I'd suggest you download it and study the code to learn the ins and outs of GPS programming. It took me literally 10 minutes to get the basics going.

Next stop - Android GPS development!

Tuesday 5 May 2009

Lots of weird errors with iPhone 3.0 SDK Beta

Today is the first day I've been doing iPhone 2.2.1 development alongside the iPhone 3.0 beta and I can tell you that things have not gone to plan.

The first nightmare I encountered was to do with the naming of my 2.2.1 app. The name has a space in it (which is not technically allowed I now understand although nothing has ever moaned before). When I tried to compile the app using the 2.2.1 framework I get the error:

com.apple.tools.product-pkg-utility: error: CFBundleIdentifier 'com.yourcompany.Project_name' contains illegal character '_'


The first thing to note here is that the only thing that's changed on this Mac since the last time I compiled the app is that I've installed the iPhone 3.0 beta SDK.

The only way I've found to get around this so far is to manually edit the "Identifier" field in the project settings to remove the space, and hard code to package identifier (not good).

The next weird thing happened when I tried running the app on a connected iPhone. (In fact the iPhone that I've been using for all of the development up until now).
When I first ran the app from XCode I received the error "The application is already installed on the device".

Obviously the app is already installed, I've been developing it for months! Normally XCode would just overwrite the app and keep all of your application settings and data, but now it seems I have to manually delete the app from the phone before hitting build and go. Extremely frustrating!

This last problem seems a little unpredictable too - I've just ran the app twice from XCode without uninstalling it and it hasn't popped up the error yet. We shall see...

I should state that all of this is with me targetting 2.2.1, I haven't ran it under 3.0 yet.

If I come up with anymore solutions or problems, I'll update this post but for now I'd better get back to making it work!

Friday 1 May 2009

iPhone 3.0 Features

After a mammoth 2.14Gb download, the iPhone 3.0 SDK beta finally landed on my Mac.

I'm not taking any chances installing it on my iPhone yet, but there didn't seem to be any problem running the simulator in 3.0 alongside 2.2.1.

On the surface, things seem like business as usual. The one major thing you notice is the new Search function of the homepage.



You now get a little magnifying glass icon on the main screen:

Swiping the screen left gives you a search box. Weirdly, this only seems to search the installed applications. I had assumed that it would be similar to the search widget on Android, whereby you can search Google straight from your homescreen. Certainly this doesn't seem to be the case for the simulator anyway, we'll see when I get it running on a phone.



With over 1000 new API's there are clearly some major new things going on with iPhone 3.0. To get you ready for the change, Apple have created some good documentation about ensuring backwards and forwards compatability with your apps. Log into the iPhone developer center and check them out.