Nexus One Update

The Day after Canada Day I was walking around Halifax and got a message on the Nexus phone that an update was ready to download.

By the size of it, it wasn’t a big surprise what it was: the 2.2 update (Froyo) had arrived. There aren’t a lot of obvious changes apart from some small changes to the interface, but most of them  seem to be under the hood. The much talked-about tethering (turn your phone into a WiFi hot-spot) is there, as are general speed improvements.

I also went to the market and downloaded the Flash player which means visiting a number of web pages is much more satisfying. In short, some new features, a bit faster, and nothing broke (yet) – I’m happy. Hopefully other Android users will be getting their updates soon.

Nexus One Experience

I’ve been using a Nexus One for about the last month on Fido’s network. Overall it’s a good phone and quite a step up from my previous, semi-indestructible, smart-phone; I say “semi” as, though the Nokia E62 handled being dropped numerous times onto pavement, torrential Toronto rain eventually did it in.

Nexus One is the AndroidOS phone that Google sold themselves up until last month, though they’re now looking to sell it through carriers over here as they’ve already started with mobile companies in the U.K. and points east. I haven’t had any real problems running on Fido, so based on my experience, putting it officially on Rogers/Fido would be a natural move – plus it’s a higher-spec. phone than Telus’ current Android models.

Setting up on Fido
While the Nexus runs just fine as a phone on Fido as soon as you pop in the SIM card, it’s not a Rogers/Fido phone so you have to set some things up yourself. For getting G3-speed data running, Brill Bappin has a great page at: brill.pappin.ca on getting the Nexus working on Fido.

Impressions
Overall, the interface is not as polished as the iPhone, but it’s definitely got more stuff in it. A case in point is WiFi; I use the free WiFi that Second Cups offers with BoldStreet networks, the problem I kept getting though with my iPod Touch was it seemed to get them confused when visiting several different Second Cups over a week. This wasn’t a problem with Android, in the odd time it got confused, I just hit the “forget” button under the connection to make it forget the old connection. On the iPhone my best guess is the Forget must be buried somewhere under the settings. On the downside, a lot of websites that seem to be only checking for iPhone and sending up the regular web page.

The camera shoots photos/video quite well during daylight. It has a auto-focus and a LED-flash, but that still doesn’t do much for night photography. One interesting thing is that it records location using the phones build-in location sensors. Using WiFi and the camera will eat up battery life and I find it needs to be charged about every other day with normal usage, though you could probably extend this by turning off WiFi/Bluetooth and background data-sync – all easily done from settings.

Software-wise, you can download apps right onto your phone – in fact, this is one of the things you get used to: not having to plug your phone into a computer to update files. Both Twitter, Facebook and FourSquare have free apps now.

Finally, one problem I had early on was with the on-screen keyboard going wonky. Google recommends: 1) make sure you’re not touching more than one place (including your sleeves), 2) turn off Nexus completely (hold down power switch, select Turn Off).

Apple: Back to 1984

It’s been widely reported that last week Apple made some changes to what tools developers can use to create applications for the iPhone and iPad. Blogger John Gruber also did a pretty solid analysis of why Apple did this: namely to keep developers developing applications that run primarily on the iPhone. I agree in the short-term this makes sense for them, but it seems like they’re forgetting some lessons.

What Apple is fighting is the commodification of a type of product, namely mobile phones and soon web tablets. This happened before to them: in the mid-1980s the Macintosh was quite innovative in terms of a user-friendliness, compared to the many of the personal computers available at the time. By the mid-1990s this had changed: Microsoft had created a “good enough” copy of the Mac experience with Windows and prices on hardware had fallen so that Apple’s products where quite expensive by comparison. The Mac continued to be popular in some circles, but had essentually became the Porsche that people bought calendars of before buying a Honda.

While the Porsche example is not perfect — people buy a high-end sports car for different reasons than they choose a phone — the challenges are not. Like Porsche, Apple has to protect its brand by demonstrating that there is a reason you are spending several hundred dollars on a phone. One of the ways it can do this by having lots of applications that are unique to the iPhone. One way to do this is make sure developers invest the time and money creating an iPhone application, and not spend that on writing for competing phones. The contract changes made last week which seem to be primarily aimed at Adobe’s Flash software are designed to ban technologies that would make it easier for developers to write applications that would run on several platforms, essentially making the iPhone’s offerings less unique. While I don’t anybody is going to be throwing their iPad into Boston harbour over this, it’s not going to help Apple’s image with developers any more than the ongoing issues with the less-than-transparent App Store approval process is doing. Short-term the effect is pretty nil, medium-term though it’s going to make the alternatives more attractive.

While the iPhone had become ubiquitous and in 2010 arguably still provides the best user experience of any smart-phone, its probably only a matter of time before someone, maybe Google, maybe RIM, maybe even Nokia come up with something good enough. Apple lost the PC market because it tried to be Porsche; Apple risks this happening again, but this time it’s not going to take 15 years.

February 2010 Update

Launched VancouverGym.ca, like Toronto-Gym.ca, it is a directory of gyms, fitness centres and health-food stores in the Vancouver/Lower Mainland area.

Why no Buzz for Google’s Twitter

Google launched Buzz last week to generally better press than Apple received seems to have received for it’s iPad, though I wonder if there are some similarities. For one thing, both of these are kind of re-imagines of already successful products. The iPad is basically the iPhone on a grander scale; if you watch Apple’s videos it’s clear they are thinking, “This is what we did with the iPhone- but what if we had a bigger screen?” Google’s Buzz of course is kind of reminiscent of Google Wave which was promoted famously as “What if we where inventing email today?” Buzz might well be asking “What if we invented Twitter today?”

There’s plenty of ways that kind of thinking can go right or wrong, but I’m wondering if what made Twitter what it is today was that it was kind of retro to begin with- and that’s what makes it fun. I’ve tried to explain Twitter to people for about 2 years now. The 140-character limit is kind of arbitrary- text messages can be up to 160 characters and computers-type limits would be multiples of 8, resulting in numbers like 128 or 256 characters.  So yes, it’s a bit of a toy, but it’s limitations are what make it a challenge, you can’t be sloppy with Twitter, it takes a bit of thinking to pack much meaning into 140 characters –spaces and punctuation included– and that in turn that appeals to certain people.

Google Buzz does away with that limit of course.  While  Buzz of course has no limits on text, it lets you add photos, links, probably video too. It’s certainly probably more practical, but it might not turn out to be as much fun.

January 2010 update

This January we launched a updated version of the Leaside Business Park website. The new website streamlines the site navigation as well as a general clean-up of the site and the code behind it.

CakePHP database config quick-tip

Most CakePHP programmers have seen this simple way of storing the development and production database settings in one file:

  1. class DATABASE_CONFIG {
  2.     var $prod = array(
  3.        
  4.         'database' => 'live_mysite'
  5.     );
  6.  
  7.     var $test = array(
  8.        
  9.         'database' => 'local_mysite'
  10.     );
  11.  
  12.    // the construct function is called automatically, and chooses prod or dev.
  13.     function __construct() {
  14.         //check to see if server name is set (thanks Frank)
  15.         if(isset($_SERVER['SERVER_NAME'])){
  16.             switch($_SERVER['SERVER_NAME']){
  17.                 case '127.0.0.1':
  18.                     $this->default = $this->test;
  19.                     break;
  20.                 default:
  21.                     $this->default = $this->prod;
  22.                     break;
  23.             }
  24.         } else { // we are likely baking, use our local db
  25.             $this->default = $this->test;
  26.         }
  27.     }

If you haven’t, check out Edward A. Webb’s original post from 1998 2008.

This same technique can be used in the bootstrap.php file for other settings that change based on the server, for instance GoogleMap keys:

  1. if ( strpos( $_SERVER['HTTP_HOST'],'MySite.com') !== false)
  2.     Configure::write('GMAP_KEY', 'ABQIAA…qcPrtZgKHQ');
  3. else
  4.     Configure::write('GMAP_KEY', 'ABQIAB…e6qfWeeY8Q');

However, when baking a model, the database file only defines two types: prog and test so you pick one and end up with a model file with a line like:

  1. var $useDbConfig = 'test';

in your baked model that doesn’t cause any problems right up until upload it to your live server late one night and start getting errors about being unable to make a connection- guess who did that?

The solution is simple: just define a default

  1. var $default;

somewhere in the file, now when you bake cake will give you the option of using the default connection which won’t add any problem-causing $useDbConfig to your model.

Hope this saves someone 20 minutes :)

December ‘09 Wrap-Up

This past December we launched 2 new websites serving the Toronto area and a re-launch of an older website.

Toronto-Gym.ca
Launched on December 27th, Toronto-Gym.ca is a directory of gyms, fitness centres and sports and health stores in Toronto and the GTA. A Vancouver version of this site is expected to be launched in early 2010.

TorontoIndustryNetwork.com
Toronto Industry Network is a group of manufacturers and manufacturing associations with operations in the City of Toronto. Collectively the Network employees approximately 35,000 people directly and another 100,000 indirectly through suppliers and customers.

Halifax-Restaurants.com
Halifax-Restaurants.com was re-launched after about a year-long break. This is a sister site to SimcoeDining.com that will be covering more places to eat in Halifax, Nova Scotia in the coming months.

Adding robots meta-tag to a CakePHP view

Here’s a little how-to I discovered a few months ago while I was working on SimcoeDining.com and realized that Google was indexing a whole lot of mostly blank pages.

To solve this, I figured I’d better put a no-index on those pages fast; after mucking around with CakePHP’s html->meta handler (because I wanted the meta tag in the header where it belonged) and not finding anything, I came up with:

  1. $html->meta('robots', null, array('name' => 'robots', 'content' => 'noindex') ,false);

BTW: The pages where empty at the time because there wasn’t a lot of data in the system, so a lot of searches where coming up empty- that’s been “fixed” now too.

Hopefully this saves someone else 20 minutes :)

MySQL’s Order By Field – this time we do it the easy way!

A few years back my company was writing a search engine for a Toronto restaurant directory. The search used tag-words to search for venues. Every time a search was done, venues where assigned a score based on how relevant there where to the tags being searched for. Now after the score was calculated, I ended up with a list of venues ordered by their score.

Now the messy part…
In oder to display these in a list, the venues had to be pulled out and listed in that order; as well, if there was more than 40 venues, they had to be split and displayed on two or more pages. In the end, it turned out the quickest way to write it was to query MySQL for each venue one at a time. Needless-to-say not an optimum solution.

…and the right way- 4 years later
When this came up last summer during the re-write of SimcoeDining.com, I figured there there had to be a proper way of solving that problem, and I found one in Imthiaz’s blog entry:

  1. ORDER BY FIELD(Venues,13,22,42,1,11)

See with MySQL (at least since v5) lets you specify a field and values to sort them by which nicely fits into CakePHP’s Paginator too.