Earlier today I came across an interesting project which provides a ‘proxy interface’ to Siri on the iPhone 4S allowing custom plugins to be created to respond to requests from Siri.
Eager to try this I hacked together a Moodle plugin for the siri proxy which would do lookups to the Moodle tracker. So, welcome Siri – the newest aid to the Moodle 2.2 QA testing effort
(The plugin I wrote is available on github. It is my first ruby script and its not particularly elegant as it was just for fun )
Over the past eight months I have been using Google Nexus S with Android as my main mobile device, having previously owned an original iPhone & iPhone 3GS. I purchased a Google Nexus S out of gadget love/ tech interest on how Android compares to iOS and then was forced to ‘switch’ fulltime after my own botched ‘repair job’ on my iPhone 3GS.
There are a number of things which attract me to Android:
Open Source: As an open-source developer and user I am ideologically aligned to an open source solution.
Its Cheaper: In the UK at least there tend to be more competitively priced deals on Android devices.
Open App Platform: Another idealogocial point – an open ecosystem sits better with me (though is distinct from an open source OS)
Google Integration: I am a heavy google user and tight integration is appreciated
Apps have much more flexible plugin points – hooks to the Phone/SMS features for example
But after eight months living with Android I can say:
Android continues to be cheaper, although the difference is reasonably small on similar speced hardware. But at the time I switched to iPhone I made the conscious decision to spend more for the luxury item (I moved from paying £10pm to £35pm…) and it turns out i’m still happy to pay extra for the iPhone
The Android marketplace is quite frankly terrible and demonstrates all of what is wrong with a completely open platform. From a consumer point of view the closed Apple App Store is fabulous. My non-technically inclined friends and family can now install and use apps without worrying about the implications. This is quite liberating – and how computing should be!
The only thing I use which the iPhone doesn’t do as well is Google Talk and searching Gmail.
I don’t actually use any apps which use this functionality, despite the attraction
The main reason I will be moving back to iOS though is slightly intangible, the extra 10% of polish and attention to detail which iOS has in abundance and android misses and frustrates me.
I have two examples of the ‘lack of polish’ to try and make it slightly more tangible:
Yesterday I took a photo with the phone and wanted to send the photo to a friend using MMS. To do this, I usually use the Android ‘share menu’ and select the messaging app. Unfortunately it turned out that yesterday I had installed one too many apps and the messaging app had disappeared off the screen with no apparent way to scroll to it (see screenshot to the right). This is an example of a great feature which Android has over iOS (the share menu) yet made useless for me in practice and is very representive of the kind of things which frustrate me about android.
In my search for a decent music player for Android I installed multiple apps (Winamp, doubletwist, Android MP3) to test out their capabilities. The nexus s comes with earphone with inline remote which can be used to play/pause/skip music (similar to the iPhone). However when I used the remote to skip a tune I had enough of I ended up starting music on one of the other apps – so i’d have two different pieces of music playing at me at the same time, completely ruining the experience. This problem got so annoying that I gave up and bought an mp3 player. Apples approach to background audio playing in apps was, firstly not allow it until iOS 4, then allow a single app to play background audio at a time, the app playing audio is controlled by the system wide controls and can also be streamed using airplay.
Android is much better than anything that was before the iPhone and a worthy competitor, but it turns out that I prefer the more restricted system with attention to detail over the ‘open enough to cripple itself’ android platform – and I haven’t even been subjected to manufacturer hindered OS Updates.
ps. there is a great blog from an iOS user trying out Android in a similar fashion to me: Dinner with Android
Having ended up with a spare iPhone from a recent upgrade I decided to try jail-breaking the old one and see what software was out there away from the restrictions of the app store. I discovered that lighttpd, php and sqlite were all available from the software repositories for download – these three combined are enough to run a Moodle server. So out the window went cleaning my flat and sensible tasks – I had to make my phone into a Moodle server!
Getting the software for moodle installed and configured was relatively painless, the ‘cydia’ software installer appears to use dpkg under the hood, so I installed openssh server and apt through the gui installer and then sshed onto the phone to do the work with a full size keyboard and the moodle server was up and running quite quickly. (More details for configuration below).
Sqlite is a really interesting technology which seems to be making its way into a lot of software and I was quite interested to see Moodle support for lightweight testing sorts of applications and it has made its way into Moodle thanks to the great work of Andrei Bautu in his GSOC project last year. It only exists in the highly unstable Moodle 2.0 development branch so I needed to install this on my iPhone. Development is moving incredibly fast in the Moodle 2.0 branch so I was not at all suprised to see that the sqlite driver was not working. It took a bit of time to find out what the major issue with the driver as it was a silent error. But I eventually found and fixed the major issue.
Sadly, despite successfully installing and passing most of the database unit tests on my development machine with sqlite, some database queries were continuing to cause the iPhone server issues. I spent some bit of time improving the sqlite driver to show more debugging information and get to the bottom of the issue.
After a lot of debugging and irritation, it seems that the sqlite library version (3.3.7) linked to from php has a bug/incompatibility which means it does not like queries like:
SELECT student.id FROM mdl_user student JOIN (SELECT ra.userid FROM mdl_role_assignments ra) roles ON student.id = roles.userid
It’ll report: SQLSTATE[HY000]: General error: 1 no such column: roles.userid
Where as it will work fine with something like:
SELECT student.id FROM mdl_user student JOIN (SELECT userid FROM mdl_role_assignments ra) roles ON student.id = roles.userid
(That was a simple example to try and find the problem – the SQL we have in moodle is a lot more complex that that).
To confuse matters, the sqlite command line tool I was using to test on the phone itself was a newer version (3.6.12), which works absolutely fine with both queries. The same was true on my development machine, which meant that I could install with sqlite succesfully everywhere but the iPhone itself. I assume the php version has been linked to the iPhone OS version – but I am too lazy to check/do something about it!
While I don’t yet have a working moodle server install running on the phone itself, the exercise in improving the sqlite driver has been really useful. I’ve updated the driver in CVS, on recent sqlite versions it is only currently failing 9 of 1298 tests. (CEIL and SUBSTR being the major issues – but they are only used for stats and the admin healthcheck) so its really looking like a really useful option for those situations where a full-grown database server is overkill.
I’ve put a video of the (disapointing) install on youtube and you can find details of the various bits of configuration below.
Configuration Details
I love apt
apt-get install lighttpd php sqlite3 git
I’ve never configured lighttpd before, but a quick search for configuring with php and I made a very simple config with /etc/lighttpd/lighttpd.conf and /etc/lighttpd/mod_fastcgi.conf
JB-Phone:~ root# cat /etc/lighttpd/lighttpd.conf
include "mod_fastcgi.conf"
server.document-root = "/htdocs/moodle"
server.port = 80
server.tag ="lighttpd"
server.errorlog = "/htdocs/log/error.log"
accesslog.filename = "/htdocs/log/access.log"
server.modules = (
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_rewrite",
"mod_auth",
"mod_fastcgi"
)
index-file.names = ( “index.html”, “index.php” )
# cat /etc/lighttpd/mod_fastcgi.conf
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket"
)
)
)
And started the webserver manually with:
lighttpd -f /etc/lighttpd/lighttpd.conf
I created the /htdocs/ directories – and git cloned moodle into /htdocs/moodle and created the moodle config file as mentioned in the sqlite moodle docs:
$CFG->prefix = 'mdl_'; // prefix to use for all table namesV
$CFG->dbtype = 'sqlite3';
$CFG->dblibrary = 'pdo';
$CFG->dbhost = 'localhost';// leave dbhost to localhost (or blank) to store the database file in Moodle data directory
Oh and I was also naughty and made the ‘zip’ php extension an optional item (as it wasn’t in the packed php version):