Categories
mobile programming

Rant About iPhone SDK

I find most of Apple’s SDK’s pretty good – but their limits are starting to show. Just wanted to briefly cover my experiences with a few.

Cocoa Touch

The SDK is not all bad. Cocoa Touch is of course, awesome. It gives you plenty of freedom while constraining you in all the right places so you don’t end up with an unusable app. Most developers can’t do UI (look at some J2ME apps and you’ll know what I mean), but most iPhone apps are quite usable. Love the IB tool once you get your head round what it’s actually doing under the scenes. The widgets are customisable enough and using NSFetchedResultsController with a table is an efficient way to bind data to a table. UITouch events are simple to understand and the way messages cascade through view controllers via their subviews is great to work with.

Music Player Framework:

This is an unacceptable interface to the iPod library simply because it’s so inflexible and querying the library using MPMediaQuery and MPMediaPredicates is so inefficient and slow.

For example when you’re searching tracks by various properties you can only do either “exact match” or “contains”. There is no way  of doing a “word begins” search like the iPod does. This would speed up some queries significantly. Furthermore, there is no efficient way to get a list of Artists, Albums, Playlists etc. You’d imagine you could just do something like NSArray *artists = [[MPMusicPlayerController iPodMusicPlayer] artists] that returns a list of artist strings but actually you have to do something really silly. You have to do a query on the whole media library and tell the Music Player Framework to group tracks into collections. These collections can be representative of your grouping criteria – which in this case would be artist. There’s lots of heavy lifting going on here as we have to retrieve all the tracks on the collection – and on my iPhone 3G with around 2GB of songs this takes more than a few seconds.

To get around this problem you can cache the music library, but although there is a mechanism for detecting an iTunes sync while your app is running, there is no way to find out exactly what has changed download photoshop cs5. There is an API call to get the last modified date of the library, but this time also includes any updates to the library metadata – e.g. track play count, which makes this useless for detecting collection changes. Apple, please do something about this!

Core Data

I started using this because I thought it would be an easy and efficient way to query a large data set with basic math in the predicates (e.g. abs(r-%f) < .28 AND abs(g-%f) < .28 AND abs(b-%f) < .28) but even though the underlying store is SQLite I realise there are so many limitations. If I wanted to fetch 50 random items, I can’t do that. I can only sort by attribute name (e.g. title descending). That’s not very helpful… I might have to go back to the drawing board and use NSMutableDictionaries instead.

Maybe its time to wipe all preconceptions of programming that I’ve learnt from web development and start getting used to the Client API way of doing things. Lots of ups and downs but we’ll get there.

Thanks for reading 🙂


Categories
interaction mobile programming

iPhone Development

Feelings... colours... emotions... sound... music?

Working on an iPhone app! The image gives it away for those who knows me or knew me well enough. Keep your eyes peeled for a preview version! ^_~

Categories
mobile social web

Social Link Recommenders

In the light of other link aggregators like Digg, Stumbleupon and Delicious; and more recently, Twine try to make the gems of the web more findable. And of course, findability is part of Peter Morville’s famous UE honeycomb so this is obviously important to people, and this can be applied by saying that we must be able to find things easily on the web. For locating that one website that answers a simple question, searching is immensely useful, but on a research project, branching out to content that may offer you lateral answers can be more difficult without asking others. A friend mentioned a research project where the web is scoured for a solution, but when you run out of hyperlinks to follow and search keywords to try, social website recommenders can offer help in finding that evasive little gem.

Everyone is incorporating social into their web applications, to the point where there is so much noise created by the new startups. The few that do emerge as being widely used can provide inspiration for the mobile. We can take aspects from the successes, remix them, and apply them to other settings. Notable here, as part of my ongoing interests in mobile UE, is the importance of mobile search. When we’re out and about we may want to find out that quick snippet of information nagging you on a train view. Or maybe you want to find out the best restaurant in an unfamiliar area. These are typical use scenarios that are immediately obvious. If we turned the latter example on its head, and describe a use scenario where people want to find better restaurants in a familiar environment, the situation becomes more difficult. No longer would users be content with a simple average “star rating” given by other visitors to the restaurant. How about finding the best steak amongst the local chinese take-aways? (Believe me, people love these wok-fried steaks.) How about the best place for a quick desert, that offers a comfortable local atmosphere?

Whoever provides a solution that lets you quickly assess the surrounding areas for recommendations based on relevant filters based on social context, specific culinary preferences, time of day, and dynamically changing qualities of restaurants that in the past can only come from word of mouth are sure to make a few bucks. Maybe we can take inspiration from (social) web 2.0 and bring this into (social) mobile 2.0.