Posts Tagged‘iphone’

Is Project Glass Google’s iPhone?

As someone who’s been deep in high technology for the better part of 2 decades it’s been interesting to watch the dissemination of technology from the annals of my brethren down to the level of the every day consumer. For the most part its a slow process as many of the technological revolutions that are unleashed onto the mass markets have usually been available for quite some time for those with the inclination to live on the cutting edge. Companies like Apple are prime examples of this, releasing products that are often technically inferior but offer that technology in such a way as to be accessible to anyone. Undoubtedly the best example of this is their iPhone which arguably spawned the smart phone revolution that is still thundering along.

When it was first released the iPhone wasn’t really anything special. It didn’t support third party applications, couldn’t send or receive MMS and even lacked some of the most critical functionality of a smart phone like cut and paste. For those brandishing their Windows Mobile 6.5 devices the idea of switching to it was laughable but they weren’t the target consumer. No Apple had their eye on the same market that Nintendo did when they released the Wii console: the people who traditionally didn’t buy their product. This transformed the product into a mass market success and was the first steps for Apple in developing their iOS ecosystem.

With the beachhead firmly established this paved the way for other players like Google to branch out into the smart phone world. Whilst they played catch up to Apple for a good 3 years or so Google was finally crowned the king early last year and hasn’t showed any signs of slowing down since then. Of course in that same time Apple created an entirely new market in the form of tablet computers, a market which Android has yet to make any significant in roads too. However whilst Google might be making a token appearance in the market currently I don’t they’re that interested in trying to follow Apple’s lead on this one.

Their sights are set firmly on the idea of creating another market all of their own.

For products that really bring something new to the table you really can’t beat Project Glass. Back when I first posted about Google’s augmented reality device it seemed like a cool piece of technology that the technical elite would love but if I honest I didn’t really know how the wider world would react to it. As more and more people got to use Glass the reaction has been overwhelmingly positive to the point where comparisons to the early revisions of the iPhone seem apt, even though Glass is technically cutting edge all by its own. The question then is whether Google can ride Glass to iPhone level success in creating another market in the world of augmented reality devices.

There are few companies in the world that can create a new market that have high potential for profitability but Google is one of the few that has a track record in doing so. Whilst the initial reviews are positive for Glass it’s still far from being a mass market device with the scarce few being made available are only for the technical elite, and only those who went to Google I/O and pony up the requisite $1500 for a prototype device.  No doubt this will help in creating a positive image of the device prior to its retail release but getting tech heads to buy cutting edge tech is like shooting fish in a barrel. The real test will be when Joe Public gets his hands on the device and how they integrate into our everyday activities.

STS-135 Atlantis Prelaunch

STS-135: One Last Time, With Feeling.

The time has finally arrived, 30 years after the space shuttle Columbia blasted off into space her sister ship Atlantis roared into orbit just 2 days ago. It is estimated that near 1 million people flocked to the areas surrounding the Kennedy Space Center to watch the final ever launch with millions more tuning in from around the world to witness it online. I have to be honest and say that I missed the live event myself, blame goes to the sources that cited a 70% chance for no-go weather on the day, but I quickly caught up with the events spending hours pouring over the details of the last ever space shuttle mission over my morning coffee the day after.

YouTube Preview Image

STS-135 is a very unique mission in many ways. It began as STS-335 a Launch on Need mission designed to be launched if STS-134 had any problems on orbit and was unable to return to earth safely. For such missions a fully stacked orbiter has to be ready to launch within a very short time frame, usually on the order of a couple months. This means the usual shuttle preparations have to already be done in order to launch that quickly and with the shuttle program retiring that meant there would be one fully loaded orbiter that would essentially go to waste. Last year saw the proposal to turn STS-335 into STS-135 approved although without any specific funding for the additional mission. NASA announced in February that the mission would go ahead with funding approval or not, setting the stage for STS-135 to be the last shuttle mission in history.

The final mission of the space shuttle also shares the record of taking up the smallest crew with one of Challenger’s early missions STS-6, bringing only 4 astronauts into space. The reason for this is simple, since there are no other shuttles available to act as rescue boats should Atlantis not be able to return from orbit those stranded astronauts will have to come back down in the regular Soyuz missions. Whilst the International Space Station is quite capable of handling the extra load for a while it will still take almost a year just to ferry those 4 astronauts back down and many of the ISS contingency plans are based around having no more than 6 astronauts on the station at any one time (without additional craft docked). STS-135 then only brings the bare minimum crew required to complete the mission and all signs are pointing to them being able to return safely so far. 

The payload of this mission is focused solely on keeping the ISS functioning for the rest of its intended lifetime, another 9 years or so. Atlantis carries in its payload bay one multi-purpose logistics module (named Raffaello) load with 16 resupply racks, the maximum it can carry, with an additional lightweight multi-purpose carrier that will be used to return some failed components back to earth for analysis. The failed components in question are a pump module for the external thermal cooling system and a ammonia pump module, both of which have already been replaced in orbit. STS-135 also carriers with an additional piece of equipment for the ISS, a proof of concept device for on-orbit refueling of satellites. For the demonstration it will be attached to the Dextre robot and should it prove successful the technology could make its way into the commercial sector. There will also be 2 iPhone 4s and 2 Nexus S’s carried up to be used with the ISS’s SPHEREs, basically small satellites that reside inside the space station. 

It’s a historic time as this mission marks the beginning of the end to a 30 year endeavor that NASA has undertaken. It might not be the most glamorous end to the program, being basically a supply mission to keep the ISS going, but it’s an important one none the less ensuring that the gap between the shuttle’s retirement and the availability of other craft doesn’t impact on NASA’s goals in space. For youngsters like me it marks the end of the iconic craft that we grew up with and I know its going to be a long time before another one will be able to take its place. For that simple fact the shuttle will always have a special place in my heart, just like I know it does in so many others.

iPhone Tracking Fiasco (Or Big Brother Isn’t Watching).

Now I love me a good piece of Apple information just like the next guy, they’re just too hard to resist as they’re some damn fine blog fodder. Still for the most part I steer clear of product speculation and rumours simply because I’m not really interested in writing on fluff and my posts would be lost in the deluge of other blogs parroting the same “facts”. Still every so often I come across a bit of Apple news that deserves reporting on, like how people were getting the whole Antennagate thing wrong,  and yesterday brought across another piece of news that had all the tech bloggers in a tizzy.

Yet again I feel they’ve all got it wrong.

What I’m talking about is the the iOS location fiasco that’s currently winding itself up in the media today. In essence its been shown that iOS devices have a log of all your location data from the day you first turned on your phone. The file in question resides on your phone but is copied across to your PC when you sync with iTunes. If you’ve selected to encrypt your backups the file will be encrypted but it is stored in plain text on your phone. People are crying foul over how Big Brother Apple is tracking them and how this is a major breach in privacy and you’d be forgiven for thinking that if you didn’t bother going beneath the surface of these stories.

Now I was considering writing about this yesterday (instead choosing to post some inane dribble, sorry) but I had really no desire to comment on something that seemed like a non-issue. Whilst I’m not keen for someone to follow my every move I was pretty sure that the location database that people were mucking around with was more than likely a cache of previous location data, most likely used in future GPS calculations to improve accuracy. Additionally there was absolutely no evidence that this database had ever made its way to Apple or anyone else for that matter and the only program that has the demonstrated ability to read those files can only do so if its unencrypted and not on your iPhone.

The privacy issue is a different beast however but in reality no one would try to use something like that location cache to track you. Whilst sites like Please Rob Me might provide insight into how such data could be used for nefarious purposes the thing is that most crime will still be committed the old fashion way, by going up to your house and seeing if anyone is there. Hiding all your location information from online sources won’t help combat this problem and the only way this database file could be used against you was if someone had direct access to your phone or PC, the former which indicates your phone has been stolen (got a pin code on that buddy?) and the latter that they’re already in your house (got a password on your PC?).

Of course in doing my research for this post today I came across a few other posts detailing my exact predictions of what the problem might be. People familiar with the matter investigated the Android platform to see if something similar was being done on their end and sure enough there was. The difference between the Apple and Android was that Android had a hard limit set on the number of records whereas the iPhone had no such limit. More than likely Apple will set an upper limit on the number of location records that are kept in the log files in the next iOS update so that people don’t get all butthurt about it again, even though there was nothing wrong in the first place.

Apple products seem to have the uncanny ability of drumming up a PR storm no matter what minor thing happens with them. Whilst this particular ability is primarily positive for Apple it seems even the Apple opposition falls prey to going hyperbolic on any little flaw in the iOS platform, creating fiascos out of what are merely features of the platform. This is why I steer clear of many Apple related articles, there’s simply too much group think on either side of the fence for there to be any proper discussion. So hopefully my little blog here has helped clarify that big brother isn’t watching you and we can all go back to our normal lives and not have to worry about Big Brother Apple watching us in our sleep.

You can still wear the tinfoil hat though, it’s sexy.

I Will Never be Rid of my iPhone (Not for lack of trying though).

The date is fast approaching April and that means the Fringe Benefits Tax year is about to roll over. For most people this is a non-event unless you’re salary sacrificing a car but for contractors like me it means I can write off another phone and laptop device on tax, effectively getting them for half the market price. Whilst it’s not as good as it used to be (you were also able to depreciate them, making said devices basically free) there hasn’t been a year yet when I haven’t taken advantage of at least getting a new phone, and last year was the first when I purchased my Macbook Pro. So of course I’ve spent the last couple weeks looking through the available selection of phones and tablets with which to gorge myself upon and the more I look the more I get the feeling I won’t be able to leave my iPhone behind like I did with my other smart phones.

The tablet choice is pretty easy since I’m not particularly fond of the iPad (I don’t need another iDevice) and getting something like the Motorola Xoom would cover off my need for an Android device to code against. To have all current platforms covered then the smart phone choice (HA! See what I did there?) would be a Windows Phone 7 handset. Taking a look around I found a few pretty good deals on various handsets with contracts comparable to what I’m on now with tons of extra value. My handset of choice is the HTC Mozart which appears to be the cream of the current crop of WP7 handsets, anything else is just too far off on the horizon to be worth considering.

Of course whenever I’m contemplating a new phone I’ll always compare it to what I currently have to see if it fixes the things that bug me and whether or not it will be worth it. Whilst my 3GS is less than a year old it’s nipping on the feet of being 2 generations behind the current trend so any recent handset should beat it hands down. A quick look at the similarly priced handsets shows this to be true all of them bristling with bigger CPUs, more RAM and better dedicated graphics. Unfortunately however there’s one thing that all the other handsets I’ve been looking at don’t cover.

That unfortunate beast is the Apple App Store.

Despite the insane growth that Android has shown over the past year Apple is still the platform of choice for many early adopters and developers. It’s extremely rare for a company to attempt to launch a mobile application on anything but Apple first, simply because the user base tends much more towards that early adopter mindset of trying things out. Sure there are many examples of popular apps that made their debut on the Android markets (although none that I’m aware of for WP7) but when you compare them to the number of success Apple can count using its platform there’s really no contest. Couple that with the fact that despite Android’s runaway popularity the App store is still by far more profitable for developers looking to sell their wares and you’d really have to be crazy not to launch on their platform.

For me this presents an interesting conundrum. Whilst I was never going to sell my 3GS since it will make a good test bed for at least another year or two I do use it quite extensively to test out potential competitor’s applications. Since most of them launch on iPhone first this hasn’t been a big deal but with me planning to move to WP7 (or possibly Android) for my main handset I can’t help but feel that I’ll probably want to keep it on hand so that I can keep a close eye on the market. Sure I could just make a note to try an application later but many up and coming products are based around using them for a particular purpose, not booting them up occasionally to see the new features. Granted this is probably limited to social applications but any new product is almost guaranteed to have some kind of social bent baked in (heaven knows I tried to avoid it for the longest time with Lobaco).

The market could change and with the growth that Android is experiencing I may be singing a completely different tune a year from now. Still until the Android store starts pumping out billions of dollars to its developers I can’t see a future where any serious developer isn’t focused primarily on Apple first with Android planned down the line. For now I think I’ll stick with my plan of a WP7 phone and an Android tablet, keeping the gaggle of devices close at my side at all times so that I can test any app regardless of its platform. It’s the same line of thinking that lead me to buy every major console, although the Wii has only ever been used a couple times.

There’s an analogy in there somewhere ;)

Lobaco Logged In

Lobaco 1.0: iPhone Testers Required!

It’s been a long 7 months since I first laid eyes on Xcode and the iOS SDK all that time ago and I’ve had quite the love/hate relationship with it. There were times when I could spend only a couple hours coding and blast through features barely breaking a sweat, and others when I’d spend multiple torturous hours figuring out why something just wasn’t working the way I thought it should. The last couple months have been quite successful as my code base has grown large enough to cover most of the rudimentary functions I use constantly and my muscle memory with certain functions is approaching a usable level. Last weekend it all came to head after I polished off the last of my TODO list and sank back into my chair.

Then it hit me, this was a feature complete 1.0 release.

Apart from the achievements (which are barely implemented in the web client) you can do everything on the iPhone client that you could do with the full web client. I’ve taken design cues from many iPhone applications that I’ve been using and I feel its quite usable, especially if you’re familiar with the myriad of Twitter clients out there. I’ve been fiddling with it over the past few days and it seems to be stable enough for me to unleash on others to see how it goes and that’s where you, my faithful readers, come into play.

I’m looking for people to beta test this application pending a full release of it to the app store. If you’re interested in testing out the application and have any 3G and up iPhone (2G might work, but it would be dreadfully slow) hit me up on my gmail therefinedgeek@gmail.com and we’ll take it from there. I haven’t really experimented with Apple’s beta testing yet so the first lot of you are more than likely to be in for a fun ride as I stumble my way through deploying the application to you, but this is all part of the fun of being a very, very early adopter :)

Despite all the trials and tribulations that developing this client has brought me the experience is proving to be invaluable as it’s helped me refine the idea down to the core ideal I started with almost 2 years ago: getting people communicating around a location. It’s also been the first new language I’ve learned in almost 5 years and it has reminded me just how much fun it was learning and creating in a completely new environment, so much so that I’m almost completely sold on the idea of recoding the web client in Ruby on Rails. Still that’s all pie in the sky stuff for now as the next big improvement to Lobaco is moving the entire service off my poor VPS and into the wonderful world of the cloud, most likely Windows Azure. I hope you’ll jump on board with me for testing Lobaco and hopefully in the future this will grow into something much more than my pet project.

Infinity Blade Black Knight

Infinity Blade: A Pocket Hack ‘n’ Slash RPG.

I’m pretty indiscriminate when it comes to my gaming platforms. I’ve got every current generation console in my house including one of each of the hand helds. So when I want to play a game that’s got a cross platform release I’ll usually take a look at how each of them are reviewing and choose the highest rated platform. Dragon Age: Origins was a great example of this as the reviews of the console versions were a lot worse than its PC counter part and I can only imagine how the problems I encountered on the PC would be magnified by running it on a console. Still there’s one platform that I’ve always considered second rate when compare to any of the other consoles I have; my iPhone. I’ve still got quite a collection of games on there but apart from Plants vs Zombies none of them could be classed above a simple time waster. That is until I bought Infinity Blade.

Infinity Blade has garnered quite a lot of press since its initial release 3 months ago as it’s the first game ever on iOS to make use of the Unreal 3 engine. The teaser screenshots released by EPIC and Chair showed that the Unreal engine had the potential to deliver much better graphics to the iOS platform, bringing the iPhone’s capabilities up to the level of dedicated gaming systems. Since all the 3D games I had tried thus far on my iPhone had been rather poor I was keen to see how Infinity Blade faired, and I wasn’t disappointed.

You play as the son of an unnamed warrior who has been killed by one of the Deathless, an immortal race of beings that appear to hold control over parts of the mortal world. Your mission is to fight your way through the various enemies that guard the Deathless’ castle so you can avenge your father. Of course you’ll probably not succeed the first time through and you will fall to the Deathless again, leaving your son to avenge you and starting the cycle anew. Over the course of the game you’ll find gold, items and health potions that will help your character along the way and these will be passed down the bloodline to successive characters.

The game doesn’t fail to impress from the get go with the gorgeous graphics filling the screen. The voice acting of the characters is done in much the same way as the Sims, being some incomprehensible gibberish that allows them to just put sub-titles on everything to make regionalization easy, but that doesn’t stop them from being adequately emotive. In-between bouts of combat you’re allowed to look around for items, chests and bags of gold that have been left lying around. You’re not able to walk freely around in Infinity Blade with travel being done by clicking on a pulsing circle to progress to the next area.

Combat in Infinity Blade is probably the most satisfying aspect of the game. Upon encountering an enemy you’re left standing in front of them until you hit the pulsing blue circle to engage with them. Upon doing so you’ll be greeted with a short cut-scene where the enemy shows off how tough they are. You’re then playing a game of dodging, parrying or blocking their incoming swings whilst attempting to hit back with swings of your own. As combat progresses you’ll move around the area you’re in, ensuring that no fight is completely static. You’re also equipped with 2 special abilities, a “super move” which will stun your enemy temporarily and a magic move which can be one of a number of spells which are granted to you through rings.

Like any good RPG the game also has a basic stat system along with a good variety of loot to augment your character with. Initially I thought it was going to be your typical dungeon crawler with all loot gathered from mobs and chests however there’s an in-game store where you can buy new weapons and armor using gold. You’ll want to do this often because as you defeat enemies you gain experience points which are attributed to your weapons and eventually you’ll master them after which they won’t grant you any more experience points. Still I found myself sticking with a few core items well after I had mastered them simply because they made the game so easy, but its quite obvious that the game would prefer you gradually upgrade rather than jump the gun like I did.

After a while however the limited variety in game play does tend to drag a bit, especially when the only challenging enemy is the Deathless and the next upgrade costs half a million gold to buy. You can get around this drag by buying a sack of gold in the store for real money, but that will only stave off the boredom until the shininess wears off your new gear. That’s not to say the game isn’t worth playing at all however as I was truly captivated for the first 5 bloodlines as I attempted to slay the Deathless that had killed my great-great-great grandfather. After that however it’s just an elaborate game of digital Barbie, looking for new items to dress up my character with.

Infinity Blade is pretty good with its execution too with the only problems I encountered being things they could not fix. Initially I couldn’t get the game past the first few loading screens but after rebooting my iPhone it went along without a hitch. Additionally I found the game’s recognition of touches and gestures to be a bit wonky at times, however this is probably more due to my notorious sweaty hands than any fault of the game developers. The iPhone can get extremely warm after a 10 minute bout in Infinity Blade so I’m sure I’m not the only one experiencing this, but there’s little any developer could do to alleviate it.

Overall I was very satisfied with Infinity Blade and the experience it created. Whilst it’s still a far cry from the games I’ve been enamored with on other mobile platforms Infinity Blade demonstrates that smart phones and tablets are quite capable of being used as a portable gaming console, something which I didn’t quite believe it was capable of. Whilst I don’t believe we’ll see any titles that can hold a candle to the releases on a fully fledged console or PC there’s still a ton of potential to be unlocked in this space and Infinity Blade has shown it can be quite profitable even for more traditional game development studios.

Rating: 8.0/10

Infinity Blade is available on most iOS devices right now at the special price of $2.99 for the Deathless Kings upade. Game was played on an iPhone 3GS with approximately 7 hours played.

Cross-Platform Technologies: The Destructive Compromise.

The engineer in me loves looking for efficiencies. So when after the first 1.0 version of Lobaco was good enough for me to call it “done” (in the sense that the feature set for it was frozen) I started thinking about the best way in which to tackle the mobile platform which I believe will be the key in achieving the goals I set out for it. I had pretty much resigned myself to go for the iPhone first as it seems to be the best place to target for early adopter types and figured the Android version could come once Lobaco gained some traction. Still the lure of being able to develop the application once and deploy it across multiple handsets in one go made the engineer in me jump up and down with delight, leaving me little choice but to explore my options.

Long time readers will know that my most recent attempt at cross platform development came the way of Sencha and 2 weeks misplaced effort in trying to get it to work. The library itself is quite comprehensive and does a good job of emulating many of the native functions that you’d expect to see on a native iPhone application. However the problem is that performance wise it’s a total dog and would require me to undergo yet another few weeks in building a fundamental base in order to achieve the same level of productivity that I had just gained with the iPhone. Whilst I’ll still have to undergo a similar amount of effort in order to learn how to program for Android I know that the eventual application that comes out of the end of that process will be much better and worth the time invested in it.

However this wasn’t my first foray into the world of cross platform development. Way back in the beginning, long before I actually got a Macbook and Xcode, I started doing preliminary research into cross platform libraries. After getting thoroughly confused with a few code examples in Objective-C a friend suggested that I have a look at the MonoTouch framework which would allow me to leverage my existing C# skills on the iPhone. The problem there wasn’t so much the language as the paradigm I was operating under and whilst using C# might’ve helped to ease me into it without a fundamental understanding of how things work on the iPhone I would’ve gone through just as much trouble in order to use that framework, without the benefits of coding natively. Not to mention being out $100 for the pleasure and still having to buy a Mac device in order to be able to use it.

The problem I find with many cross platform technologies is that they have the unfortunate problem of making compromises when it comes to conflicts between platforms. Sencha, for all its goodness, has decided to look like an iPhone application. This is great, on the iPhone, but for any other device it’s going to be a drastic shift away from the experience the user is expecting. Even cross platform libraries that generate native code will still suffer from destructive compromises because of the different ways in which the major smartphone OSs go about their tasks. Thus you either constrain yourself with limited functionality or you have to cater for those special usage type scenarios, negating the power of the framework you’re using. Cross platform libraries are fantastic in some use cases, but their applicability is really quite limited.

If you’re looking to target multiple platforms I still believe it’s best to go for the native option, even if the development investment will be much higher. Realistically choosing a single platform to begin with isn’t a bad idea with both Android and iPhone (although Android is probably your best bet) being quite viable to test if the market will respond well to an idea. If your idea has legs then you can take the time to invest in some of the other platforms, delivering a much better end user experience. Cross platform technologies might work for some ideas but unless you’re doing nothing above the rudimentary you’re much better served by going native.

 

Necessity is the Mother of Invention.

I’ve been developing computer programs on and off for a good 7 years and in that time I’ve come across my share of challenges. The last year or so has been probably the most challenging of my entire development career as I’ve struggled to come to grips with the Internet’s way of doing things and how to enable disparate systems to talk to each other. Along the way I’ve often hit various problems that on the surface appear to be next to impossible to do or I come to a point where a new requirement makes an old solution no longer viable. Time has shown however that whilst I might not be able to find an applicable solution through hours of intense Googling or RTFM there are always clues that lead to an eventual solution. I’ve found though that such solutions have to be necessary parts of the larger solution otherwise I’ll just simply ignore them.

Take for instance my past weekend’s work gone by with Lobaco. Things had been going well, the last week’s work had seen me enable user sign ups in the iPhone application and had the beginnings of an enhanced post screen that allowed users to post pictures along with their posts. Initial testing of the features seemed to work well and I started testing the build on my iPhone. Quickly however I discovered that both the new features I had put in struggled to upload images to my web server, crashing whenever a picture was over 800 by 600 in size. Since my web client seemed to be able to handle this without an issue I wondered what the problem would be, so I started digging deeper.

You see way back when I had resigned myself to doing everything in JavaScript Object Notation, or JSON for short. The reason behind this was that thanks to it being an open standard nearly every platform out there has a native or third party library for serialising and deserialising objects, making my life a whole lot easier when it comes to cross platform communication (I.E. my server talking to an iPhone). Trouble with this format is that whilst it’s quite portable everything done in it must be text. This causes a problem for large files like images as they have to be changed into text before they can be sent over the Internet. The process I used for this is called Base64 and it has the unfortunate side effect of increasing the size of the file to be transferred by roughly 37%. It also generates an absolutely massive string that brings any debugger to its knees if you try to display it, making troubleshooting issues hard.

The image uploading I had designed and successfully used up until this point was now untenable as the iPhone client simply refused to play nice with ~300KB strings. I set about trying to find a solution to my problem hoping to find a quick solution to my problem. Whilst I didn’t find a good drag and drop solution I did come across this post which detailed a way in which to program a Windows web service that could receive arbitrary data. Implementing their solution as it is detailed there still didn’t actually work as advertised but after wrangling the code and over coming the inbuilt message size limits in WCF I was successfully able to upload images without having to muck around with enormous strings. This of course did mean changing a great deal of how the API and clients worked but in the end it was worth it for something that solved so many problems.

The thing is before I went on this whole adventure had you asked me if such a thing was possible I would’ve probably told you no, at least not within the whole WCF world. In fact much of my early research into this problem was centred around possibly implementing a small PHP script to accomplish the same thing (as there are numerous examples of that already), however the lack of integration with my all Microsoft solution means I’d be left with a standalone piece of code that I wouldn’t have much interest in improving or maintaining. By the simple virtue that I had to come up with a solution to this problem meant I tried my darnedest to find it, and lo I ended up creating something I couldn’t find anywhere else.

It’s like that old saying that necessity is the mother of all invention and that’s true for both this problem and Lobaco as an idea in itself. Indeed many of the current great Internet giants and start ups were founded on the idea of solving a problem that the founders themselves were experiencing and felt that things could be better. I guess I just find it fascinating how granular a saying like that can be, with necessity driving me to invent solutions at all levels. It goes to show that embarking into the unknown is a great learning experience and there’s really no substitute for diving in head first and trying your hardest to solve an as of yet unsolvable problem.

Why Mobile Gaming Isn’t Killing Other Platforms.

I remember my first mobile phone well, it was a Nokia 8210 that I got myself locked into a 2 year contract for mostly because I wanted to play snake on it. After having the phone a month (and subsequently having it stolen) I grew tired of the game and resigned myself to just using at it was intended, as a phone. This continued with all my following phones for the next few years as I favoured function and form over features, even forgoing the opportunity to play old classics like Doom on my Atom Exec. However after picking myself up an iPhone early last year I started looking into the world of mobile gaming and I was surprised to see such a healthy games community, grabbing a few free titles for my shiny new gadget.

Primarily though I noticed that the vast majority of games available on the App Store were from small development houses, usually ones I’d never heard of before. Whilst there were a few familiar titles there (like Plants vs Zombies) for the most part any game that I got for my iPhone wasn’t from any of the big publishers. Indeed the most popular game for the iPhone, Angry Birds, comes from a company that counts a mere 17 people as its employees and I’m sure at least a few of them only came on since their flagship title’s release. Still the power of the platform is indisputable with over 50 million potential users and a barrier to entry of just one Apple computer and a $99 per year fee. Still it had me wondering though, with all this potential for the mobile platform (including Android, which has sold just as many handsets as Apple has) why aren’t more of the big names targeting these platforms with more than token efforts?

The answer, as always, is in the money.

Whilst the potential revenue from 50 million people is something to make even the most hardened CEO weak at the knees the fact remains that not all of them are gamers. Heck just going by the most successful games on this platform the vast majority of Android and iPhone owners aren’t gamers with more than 80% of them not bothering to buy the best game available. Additionally games released on the mobile platform are traditionally considered time wasters, something you’re doing when you don’t have anything better to do. Rarely do you find a game with any sense of depth to it, let alone does such a game strike it big on the platform’s application store. Couple that with the fact that no mobile game has gotten away with charging the same amount as their predecessors on other platforms has and you can start to see why the big publishers don’t spend too much time with the mobile platform, it’s just not fiscally viable.

For the small and independent developers however the mobile scene presents an opportunity unlike any they’ve seen before. Whilst there is much greater potential on other platforms (The Xbox 360 and Playstation 3 both have user numbers rivalling that of the iPhone and Android platforms) the barriers to entry for them are quite high in comparison. Microsoft, to their credit, has reduced the barrier to the same level as the iPhone ($99/year and you bring your own console) but thus far it has failed to attract as much attention as the mobile platform has. Other platforms are plagued by high investment costs for development such as any Sony or Nintendo product, requiring expensive development consoles and licenses to be purchased before any code can be written for them. Thus the mobile platform fits well for the smaller developers as it gives them the opportunity to release something, have it noticed and then use that to leverage into other, more profitable platforms.

I guess this post came about from the anger I feel when people start talking about the iPhone or Android becoming a dominant player in the games market. The fact is that whilst they’re a boon for smaller developers they have nothing when compared to any of the other platforms. Sure the revenue numbers from the App Store might be impressive but when you compare the biggest numbers from there (Angry Birds, circa $10 million) to the biggest on one of the others (Call of Duty: Black Ops $1 billion total) you can see why the big guys stick to the more traditional platforms. There’s definitely something to the world of mobile gaming but it will always be a footnote when compared to its bigger brothers, even when compared to the somewhat beleaguered handheld, the PSP.

Fast Scrolling UITableView: Updates for iOS 4.2.

I’ll be honest and say that most of the programs I’ve built have never really been that resource intensive so optimising them for performance really hadn’t been much of a priority. Sure there were the occasional thing that I’d catch and try to improve, like when an early copy of Geon had a dropped shadow around the map that inexplicably made it run like a dog, but for the most part I’d just code them up and leave it at that. Coding for the iPhone and other resource poor systems however does not afford me such luxuries and performance tuning the app has taken up a considerable amount of my development time, but the pay offs have been quite great.

After getting my first shot at the Lobaco app up and running I noticed there was considerable slow down when scrolling through the main list of items. Since I’m a big fan of the official Twitter app I knew that it was possible to have quite smooth scrolling even when you had multiple images and gobs of text on the screen. As it turns out I wasn’t alone with this performance problem with UITableViews (the class used for that main list display) and the developers behind it posted up some code to demonstrate how they achieved such fast scrolling.

If you follow that link you’ll notice that that particular blog post is now over 2 years old, back when the iPhone 3G was still the top offering from Apple. Whilst the code given in that blog post still functions I ran into a couple of issues implementing it in the latest SDK (4.2). The first issue you’ll hit when trying to use this code is the initWithFrame function, which is used to create your cell, is now deprecated. Whilst it should still function I could not get my code to work until I made the following change in ABTableViewCell.m:

// Copyright (c) 2008 Loren Brichter
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
//  ABTableViewCell.m
//
//  Created by Loren Brichter
//  Copyright 2008 Loren Brichter. All rights reserved.
//

#import "ABTableViewCell.h"

@interface ABTableViewCellView : UIView
@end

@implementation ABTableViewCellView

- (void)drawRect:(CGRect)r
{
	[(ABTableViewCell *)[self superview] drawContentView:r];
}

@end

@implementation ABTableViewCell

/*- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier])
	{
		contentView = [[ABTableViewCellView alloc] initWithFrame:CGRectZero];
		contentView.opaque = YES;
		[self addSubview:contentView];
		[contentView release];
    }
    return self;
}*/

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
	if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
	{
		contentView = [[ABTableViewCellView alloc] initWithFrame:CGRectZero];
		contentView.opaque = YES;
		contentView.backgroundColor = [UIColor whiteColor];
		[self addSubview:contentView];
		[contentView release];
    }
    return self;
}

- (void)dealloc
{
	[super dealloc];
}

- (void)setFrame:(CGRect)f
{
	[super setFrame:f];
	CGRect b = [self bounds];
	b.size.height -= 1; // leave room for the seperator line
	[contentView setFrame:b];
}

- (void)setNeedsDisplay
{
	[super setNeedsDisplay];
	[contentView setNeedsDisplay];
}

- (void)drawContentView:(CGRect)r
{
	// subclasses should implement this
}

@end

The main change is to replace the old initWithFrame with the new initWithStyle. This also requires changing the super call to the UITableViewCell class we’re subclassing, but apart from that everything else remains the same. Once I had that problem out of the way my custom cells were now drawing properly and appeared to be scrolling much more smoothly than they were before. However I was noticing another strange issue with my cells, they seemed to be displaying data at random from my data array. Try as I might to find the solution to this problem I couldn’t, until went back to the fundamentals of the UITableView.

You see creating cells with a UITableView is a pretty expensive process, just as it is for any system when creating new objects. This is even more pronounced with the resource limitations of the iPhone and so the iOS SDK employs a simple trick to work around this. Instead of creating and deleting a new cell every time one is needed it will instead reuse a cell that’s no longer in use, I.E. one that’s scrolled off screen. Since the cell will usually have new data in it at this point when it comes back on screen it should redraw itself to reflect this. However it seems that the ABTableViewCell class wasn’t doing this and the only way I could get it to update the data was by clicking on the cell, which caused a refresh.

If you’re not using this class then you’ll probably never encounter this issue and I believe this is because of the way ABTableViewCell does it’s drawing. You see in order to get the performance improvement you’re basically bypassing the regular way of drawing the cell and doing it yourself. This has enormous performance benefits since you’re not doing any unnecessary drawing, but it appears that the UITableViewCell class doesn’t call the drawContentView function as part of its normal drawing routine anymore. Thankfully this can be solved with a one liner in your UITableView controller class by letting the cell know it needs to redraw itself with setNeedsDisplay:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";
	int nodeCount = [displayItems count];

    LobacoTableCell *cell = (LobacoTableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        //cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
		cell = [[[LobacoTableCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    }

    // Configure the cell...

	if (nodeCount > 0)
	{
		Post *post = [displayItems objectAtIndex:indexPath.row];
		cell.post = post;
		if (!post.profileImage)
		{
			if (self.tableView.dragging == NO && self.tableView.decelerating == NO)
			{
				[self startImageDownload:post forIndexPath:indexPath];
			}

			cell.image = [UIImage imageNamed:@"Placeholder.png"];

		}
		else
		{
			cell.image = post.profileImage;
		}
	}
	[cell setNeedsDisplay];
    return cell;
}

I do this after I’ve done all the reconfiguration of the cell so that it’s drawn with all the correct information. The image code in this part will also trigger a redraw of the cell when it’s finished downloading the image (in this case the user’s profile picture) ensuring that it’s displayed immediately rather than when the drops out and comes back into view again. With all these fixes in place my new custom UITableViewCell works perfectly and the scrolling performance is glassy smooth.

All of the above issues I encountered after I upgraded my Xcode installation to iOS 4.2 and despite my intense Googling I couldn’t find any real solutions to these problems. If you’re a budding iPhone developer like me struggling to figure out why some things just aren’t working the way they should I hope this post gives you a little insight into what was going wrong and ultimately how to fix it. It’s these kinds of curious problems that frustrate the hell out of me when I’m in them but they’re always quite satisfying once you’ve managed to knock them over.