The online home of Brave Location Services Ltd.

Developing for Heroku and Node.js on Windows

So I’ve been playing about with some hopefully interesting ideas I’ve been having for a new app - more soon when we have a bit more traction - and have been hacking about using Node.js and MongoDB on Heroku.

It’s been great fun learning some new things, but as ever things have been slightly harder because I’m developing on Windows rather than on a Mac or Linux laptop. Anyway, I thought I’d capture a few things I had to figure out along the way (mainly via Stack Overflow) here, both so I don’t forget them and in case they come in useful to someone else.

Installing MongoDB drivers for node.js

This stumped me for a while. In theory, it should be as simple as running:

npm install mongodb

However, the module has a dependency on the bson module, which will compile itself on install. In theory this shouldn’t be a problem, but out of the box npm is looking for the Visual Studio 2010 C++ compiler, and I only have Visual Studio 2012 installed - and definitely don’t want to install an earlier version as well.

After much searching, I found that there is an option to use VS2012 by using the command:

npm install mongodb --msvs_version=2012

… and everything installed and worked like a dream.

Running Heroku’s Foreman on Windows

I’ve been pretty impressed with the Heroku stack so far. It’s really easy both to deploy your changes by a Git push, and the command-line tools you get make it easy both to configure and monitor what’s going on.

One of the tools was slightly problematic, as Foreman - basically an easy way of running your apps locally - didn’t actually work properly.

Thankfully this was a known issue in version 0.62.0, and the solution was to use 0.61.0 instead which can be installed using:

gem install foreman -v 0.61

… making sure you’ve uninstalled it fully first (using the uninstall command)

Bedside Clock code now on Github

A few weeks in with my iPhone and I’m very happy with my choice.

The iOS interface is fine, and although I do miss the “Metro” interface of my Windows Phone, having a massive choice of good and interesting apps makes up for that by far.

A perfect example is being able to use Instagram. I’ve really enjoyed taking some gratuitous photos and sharing them with the community there. Nothing unusual there for most people, it’s just it’s still not available as an app for Windows Phone.

Anyway, that means I’m definitely not going to be developing my Bedside Clock any more, so I thought I’d share the code on Github so if anyone does want to extend the app they can do.

This was originally a project just for me to learn about developing for Windows Phone, and to replace the better built-in clock I was missing from my Android phone. You can probably tell this with some of the slightly gratuitous features I added (phase of the moon calculations anyone?)

It’s done reasonably well at the App Store with around 14,000 downloads as of April 2013 - which is far more than I ever dreamed of! I learnt a lot building it, and I used it every night when working away in London, so it definitely had at least one satisfied user.

If any of you are interested in forking the code, extending the app or fixing any bugs you spot, I’d be very happy to help get them merged into the code base and releasing the out into the wild.

And the winner is ... iPhone

So after my earlier post when I said I was going to get a Nexus 4, after a lot more pondering I’ve actually ended up buying an iPhone.

So what made me change my mind?

The main reason was I just wanted the phone with the best set of apps. The longer I prevaricated, the more I realised the interesting apps mentioned in the tech press are almost always iPhone first - and I didn’t want to miss out any more.

From a dev point of view, I am also thinking of getting a Mac Mini anyway for working on my own stuff, which will solve the ability to make my own apps.

I find it really interesting how the Mac has morphed into a dev machine - I guess the UNIX underpinnings means server-side technologies work more naturally there. For example, I was trying to get Ruby on Rails working on my Windows laptop, and it was just painful. However all the install instructions were Mac friendly, which makes a lot of sense.

Anyway, I hope I don’t regret my decision. One day in it’s been great to try out a whole load of interesting and experimental apps that are nowhere near being released on Windows Phone.

It’s also very interesting the reaction you can get when you tell some people what you’ve done - sometimes it’s almost like I’ve commited the heinous crime of changing which football team I support, rather than just getting a new phone!

Final version of my Bedside Clock app shipped for Windows Phone 8

It’s been a great learning exercise, but I think I’m finally done with my Bedside Clock app for Windows Phone.

This was originally a project just for me to learn about developing for Windows Phone, and to replace the better built-in clock I was missing from my Android phone. You can probably tell this with some of the slightly gratuitous features I added (phase of the moon calculations anyone?)

However I’m almost certainly moving off Windows Phone very soon - and to be fair there isn’t much of interest left to do in the app - so other than fixing any serious bugs that are found I think I’ve finished working on the app.

The new version (4.0.0.1) is just for Windows Phone 8, although there are no new features compared to the earlier versions. I’ve just refactored the code a little to work with the new SDK, and added support for the new icon sizess and different screen resolutions supported by WP8.

As ever, it took a couple of attempts to ship the app. The Store test team seem pretty thorough in their testing, and they found a minor logic bug in the back button logic which had changed in WP8. This was easy to fix, but it is very irritating that you have to re-enter all of the store details and screenshots everytime, even when it’s just a minor changed to the XAP executable file.

If you haven’t already got my app and want to give it a try, click on the Windows Phone icon below to install it from the Windows Store, and let me know what you think!

Go to Windows Phone Store

Choosing a new phone

Now I’m leaving Microsoft I’ll lose my corporate Windows Phone - and obviously I get to choose what to replace it now I’m paying for it myself.

It’s tough to know what to do, so I thought it might be interesting to look at different options and work through the pros and cons of each to help me decide what to do.

Option 1: Sticking with Windows Phone

I’ve really enjoyed my Windows Phone 7 (I haven’t been upgraded to WP8 yet). It’s a great interface, with the live tiles making it easy to see useful information at a glance. I’ve also enjoyed developing for the platform, with creating my Bedside Clock app being a great learning experience as well as being downloaded a surprising 16,000 times as of February 2013.

However.

I’m just sick of missing out on many of the most interesting apps (Instagram as a prime example) because I’m on the 3rd platform in an ecosystem almost completely dominated by the big two.

I don’t think there has ever been an app that has been released on Windows Phone first - not one I’m interested in anyway - and I just can’t see the platform gaining any traction any time soon. Sadly I think Windows Phone has just lost.

Option 2: Getting an iPhone

Much favored by my soon to be ex-colleagues at Skype, I’ve had a chance see more iPhones recently, and it can’t really be disputed that they are excellent phones.

All the newest and most interesting apps are bound to be available (sometime exclusively) on iOS, so you’re never going to be missing out choosing an iPhone.

Apple also seem to an excellent job of upgrading their older phones where possible, so you’ve good chance of always being on the latest and greatest version.

I see a couple of downsides though.

First, with Apple you definitely pay a premium price for their hardware and once in their ecosystem you don’t have much/any choice other than to stay in it. I don’t really want to pay that premium, or commit myself down that road. I’m not sure I can face using iTunes again.

More importantly, if I want to do any app development I’ve got to fully invest in Apple hardware - which means getting some sort of expensive Mac. This is a non-trivial cost too, and I’m not sure I’d ever feel comfortable again having a phone that I couldn’t easily knock out an app for if I had a need right now.

I’m very happy with my Dell Ultrabook, and may well consider a Macbook for my next development machine - but not right now.

Option 3: Moving to Android

Getting an Android phone sounds like the ideal compromise for me. Some of the latest hardware is very nice, and the ecosystem has a range of apps available very close to that of iOS.

Also, with a copy of Eclipse on my Windows laptop it will be pretty straightforward to develop some apps without a big investment in additional hardware.

So what’s the downside? Well, the Android interface is just a little ugly. I had an Android phone about 3 years ago and it just didn’t have the polish of the other systems. Maybe things are much improved with Android 4.0+ though? And maybe I don’t really care so much about that polish if the functionality is there?

Option 4: Blackberry

No

And the winner is …

So after all that, I think I’m going to get a Google Nexus 4.

Why that handset? I think from a developer’s point of view, having a phone that has the best chance of being updated - in the totally fragmented Android ecosystem - seems a good idea.

Disagree?