Monday, 11 February 2013

Ubuntu Cross-Platform Mobile Setup

I had 3 candidates for a cross-plattform development framework, Cordova, Appcelerator and Corona not knowing which to choose I looked at all three.


I liked the look of this framework, but it doesn't work with Linux (although it could be possible to make Corona work with Ubuntu with a little hacking.). It's Java based (remember 'write once, run anywhere'?) so I don't know why they don't fix it, but that's one down.


Cordova on Linux
Cordova on Linux

There aren't instructions for Linux -but the Mac ones looked reasonable so I thought that I'd give it a go. I already had Android Developer Toolkit installed so I adjusted the paths accordingly, ran the create script, and it fell flat on it's arse. Not a good start. Did the obvious and fixed the permissions, still no joy. Had a look at the script and several lines ended with '&> /dev/null' -hmm. I write scripts that go '1>/dev/null 2>&1' so I assume that is what these mean. Maybe the other syntax is a Mac thing, but on my machine it ends up with processes being backgrounded that shouldn't be as the script then tries to remove files that aren't downloaded yet. I deleted the  '&> /dev/null'  and 'create' generates a project.

Fire up the ADT , based on Eclipse (oh well), open up the project as described in the instructions, Eclipse hides it from me, eventually find the right button. Attempt to deploy the script ADT dies horribly, there are a few libcurses5 errors that I have been ignoring. Turns out the Android SDK is 32 bit, wheras I have a beefy 64 bit machine, 'apt-get install lib32ncurses5 lib32stdc++6' sorts this out for me. I fire up ADT redeploy and hey presto!


Titanium Appcelerator on Linux
Titanium on Linux

They make me sign up, and then immediately want an update, some smart marketeer on the job counting the number of fields that we'll fill in at once. Having done that it's off to the Titanium Quick Start Guide.

Next we download, unzip and run Titanium Studio (again Eclipse based), so far so good, the first thing it wants to do is update itself and it runs into a problem with nodeJS. Fortunately this is documented and after following a couple of links I run :

   sudo add-apt-repository ppa:chris-lea/node.js
   sudo apt-get update
   sudo apt-get install nodejs npm

and we are off to the races.

I was able to point the SDK at the one in ADT, which saved a bit of time, although I also installed Android 2.2 as that's what my ancient phone uses, and then ran through the rest of the Quick Start with the result above. The emulator takes forever to fire up, but Eclipse looks a lot more rational than it does in Cordova.

No comments:

Post a Comment