For the past 3 weeks I’ve been working on a mobile website for a hybrid iPhone app. We were already using Spine.js – as I mentioned in a previous post – and therefore Spine.js mobile was an attractive choice for building the mobile part of our website.
One of the things that really confused me about Spine.js was getting it integrated into a Rails application. For starters, if you go to the Spine.js homepage you see a nice big download link. If you go to the Spine.js mobile homepage there is no link to be found. I still don’t quite get the reason behind this.
The examples for Spine.js mobile all suggest that you use Node.js and create you app with the relevant npm packages – Hem, GFX and jQuery. We obviously didn’t want to introduce any of these technologies so we needed to do a bit of investigation to get everything running. We eventually used a fork of a gem on github, which hasn’t given us any problems.
What is Spine.js Mobile
Using Spine mobile means you’re using the regular Spine library plus a few added features. You get the concepts of Stages and Panels which extend the regular Spine controllers and allows you to do transitions. The documentation on this is pretty good and if you’re used to Spine everything will be straightforward.
Basically you’re getting the regular Spine framework plus a few classes and some html and css that will make your site look like an iPhone app. I was impressed with how easy it was to use the framework – as I was already familiar with Spine it was a very quick spike to get a mobile site up and running. Overall the framework delivered exactly what we wanted – an easy way to create a hybrid iPhone app with Spine.
Not everything is plain sailing however – there are some features which seem to be half-implemented. For example, by default every ‘panel’ (which is basically a single page in our mobile site) is divided into header, body and footer. The header is styled automatically and you can easily add buttons and set the title. However, there is no way to control the footer – which isn’t the end of the world, but it can be frustrating when you try to use it.
Integration into Rails
At the end of this file simply include your Spine mobile app.
Overall I think Spine Mobile is a really good and very promising framework. It’s very lightweight and easy to adopt. It definitely delivered exactly what we were looking for and I would highly recommend it.