SOS

Shane O’Sullivan’s technical blog… really ties the room together

Irish Rain for the Palm Pre

Posted by Shane O'Sullivan on 14 November, 2009

I’ve just released a useful little free application for the Palm Pre called Irish Rain.  It’s a weather application that shows the satellite footage for the last three hours of rainfall over Ireland.  Rather than having to rely on vague and often wrong weather forecasts, you can look at where the rain has been for the last three hours, with the map being animated so you can see the direction it is heading.

Irish Rain also shows the weather forecast for the today and tomorrow, for the main cities of Ireland.

For installation instructions, see http://chofter.com/apps/?n=irishrain

Update: I’ve now also submitted it as a free app to the Palm App Catalog.

Posted in Irish Rain, Palm, Technical, WebOS, mobile | Tagged: , | 2 Comments »

CelText for the Palm Pre – Send texts for free

Posted by Shane O'Sullivan on 19 October, 2009

I’ve just released the first version of CelText, an application for the Palm Pre smartphone.  CelText enables users in Ireland to send text messages for free, using the free web texts available from their mobile provider, either O2, Meteor or Vodafone.

This version of CelText is completely free, and can be installed using the PreCentrals Homebrew installation process, described here – http://www.precentral.net/how-to-install-homebrew-apps .

You can get CelText from http://www.precentral.net/homebrew-apps/celtext .  I’ve just submitted it, so it may not be available for a day or so after this post (Oct 19th 2009).

If you have any issues with it, there is a discussion forum at http://forums.precentral.net/showthread.php?p=1985016 where you can let me know about any bugs that may be present.

For anyone interested in the technical aspects of how CelText is written, for the most part it uses Palms development tools, but I use the Dojo Ajax Toolkit for a number of tasks, including animations and Ajax calls.

Posted in Dojo, mobile | Tagged: , , , | 2 Comments »

Palm Pre from iPhone3g: first impressions

Posted by Shane O'Sullivan on 17 October, 2009

My iPhone 3G died a few weeks ago after rudely jumping out of my pocket and onto some gravel, so I took the opportunity to upgrade to the new Palm Pre smartphone.  My main reasons were mainly that it looks very cool, and writing applications for it is really, really easy if you know HTML and JavaScript.palmpre

I’ve now had it one whole day, so here are my initial impressions.

Pros

  1. Obvious I know, but the multitasking is fantastic.  I got used to using multiple applications at the same time, that I don’t know how I ever did without it on the iPhone.  For example, playing a radio app and browsing the web. On the iPhone, the music stops.  On the Pre, it doesn’t.
  2. Moving from application to application is much faster for me.  This includes loading new applications, and switching to new ones.  One of the reasons for this is the much publicised card metaphor WebOS uses, but just as useful is the task bar at the bottom that can be launched using the gesture area at the bottom.  Some reviewers have claimed that it’s just eye candy, since you can access the same controls by exiting out of an application into the “card view”.  However, using the gesture area, you don’t even have to exit an application to launch another.  It’ s just very quick and simple.
  3. Integration with Gmail and Facebook contacts is simple to set up and well implemented.
  4. The camera is better than the iPhone, and has a flash.  This doesn’t mean it’s actually any good.  Just better than the iPhone 3G.
  5. Bluetooth works better than the iPhone.  My Bluetooth headset, a Sony DR-BT140Q, worked with the iPhone, but couldn’t change the music track that was playing.  With the Pre, all the Bluetooth headseats functions work as they should.
  6. The keyboard is better than the iPhone onscreen keyboard.  While the keys are small and fiddly, I’m already typing more quickly that I could on the iPhone after a year of usage.
  7. Turning on and off the Wireless and Bluetooth is much easier and quicker in the Pre.
  8. The Pre can be used as a simple USB storage device.  The iPhone cannot.
  9. The biggest Pro for me by far is that applications are SOOOOOOOO easy to write.  I’ve already written a couple, and will write more.  Unlike with the iPhone, I don’t need to buy a Mac just to write an application for a bloody Phone.  Tying a phone to a single computer type and operating system for development is a sign of real arrogance on the part of Apple.  “They’re going to want to write apps so bad for our phone we can force them to fork out on a new computer“.  Palm don’t suffer from the same hubris, perhaps because they are playing catch up, but I don’t care.  You can write WebOS applications on Windows, Mac and Linux (yes, Linux!), using just HTML, JavaScript and a little CSS.  WebOS rocks. Update: My first application is now available for free, see http://wp.me/p15eg-5i

Cons

  1. The build quality of the Pre is not as good as the iPhone. As many reviewers have pointed it, it feels a bit plastic (ok a lot plastic).  The sliding mechanism could be better. It can be a bit awkward to slide open the phone when an application is live on the screen using just one hand, and the mechanism doesn’t give a good tactile feel when it slots into place.
  2. The keys are a bit awkward to use.  While I still prefer the keyboard to the iPhone, there is plenty of room for improvement.
  3. Getting music onto the phone was a bit of a nightmare.   It doesn’t currently work with iTunes, as I presume Apple have, in their postition of Microsoft V2, have blocked Palm from cheekily pretending to be an iPhone.  The unforgivable part of this is that Palm seem to have given no other option that enables you to put music on your phone! After some Choftering, I found a handly program called DoubleTwist, which can be used to manage the music on the Pre.  However, the simple fact that I need to use this is a massive fail for Palm.  There’s no excuse for them saying “You need another companys software to use our phone, and we’re not giving you even a less functional application to do the same”.
  4. The swipe motion to go “back” in an application is awkward with one hand.  You almost have to concentrate on NOT dropping the phone when doing it.  This is definitely a two-handed device.
  5. No native Facebook application.  Apparently it’s on the way, but that’s no good to me right now.  Get it sorted Palm! Facebook are a partner of Palm, what’s the hold up?
  6. The process for selecting text is very awkward, and I definitely prefer the iPhone’s method of selecting, copying and pasting text.
  7. When I got my iPhone, my girlfriends first impression was “Wow, it’s so cool!”.  Her first impression of the Pre, after 10 seconds, was disappointment.  No matter how much I tried to say “Look at the cool operating system, better camera etc”, you don’t get a second first impression.  I can definitely see a number of people not buying it if they simply pick it up in a shop without appreciating what’s inside.  Perhaps it’s the plastic feel, the screen that is slightly smaller than the iPhone (people don’t really care if it’s the same resolution), I don’t know.  But it’s undeniable.

Conclusion

I’m really happy with the Pre.  While the build quality could be much better, it’s all about the operating system for me.  I can’t wait to get more and more applications written for it.

Digg It

Posted in Technical | Tagged: , | 1 Comment »

One more twit goes a-twittering

Posted by Shane O'Sullivan on 5 October, 2009

Ok, I gave in, I’m on Twitter – http://twitter.com/chofter , user @chofter.  I promised myself I wouldn’t join, because I didn’t see the point.  Hmpfh, well, there that goes.  I’ve now promised myself I’ll only write pertinent updates, not the inane crap people post about what kind of soup they had that morning.

If you’re interested in seeing how long this latest resolution lasts, or if you want to hear whatever craziness I have to impart on the tech world, dojo toolkit, or open source worlds, feel free to follow my posts (I refuse to say tweets. Damn, I just said tweets. Damn, said tweets again. Damn it…. etc)

Posted in Technical | Tagged: | 2 Comments »

Dijit Tree now ultra-stylable

Posted by Shane O'Sullivan on 1 October, 2009

The Dojo Tree has always been easy to make look just like you want, from changing the icons to changing the labels.

However there was always a limitation in that an entire row could not be styled.  Well, today I put through a fix for that, and you can now specify a CSS class and style for each row using the getRowClass and getRowStyle functions.

You can see a simple test of this at http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/tree/test_Tree_Styling.html , available from Oct 2nd 2009, and it’ll be included in version 1.4, which goes into beta any day now.  It shows how you can easily make the tree appear like an expandable, nestable list widget, with just a tiny bit of CSS.

I also plan on writing up a number of dojo.cookie articles over at dojocampus.org in the coming weeks on all the cool things you can do with the tree.

treeStyle

Posted in Dojo, Javascript, dijit, open source | Tagged: | 2 Comments »

Ubuntu – good enough for grannies and girlfriends

Posted by Shane O'Sullivan on 29 September, 2009

I recently installed Ubuntu Linux 9.04 on my girlfriends lovely new EEE Netbook (I highly recommend the 1005HA + EEEBuntu), but left the original Windows install intact, because, well, I’ve always had a need to go back to Windows for 30 minutes at some point for some reason or another.

The one problem I foresaw with this Ubuntu install was that if she ever had to use the Huawei Mobile Broadband modem I have, she’d have to boot into Windows.  I’d read a year ago that Ubuntu supported it, but when I tried with Ubuntu 8.10, it failed miserably.

So today I was using her netbook and needed mobile broadband, and was about to boot into Windows, when I thought “what the hell”, and tried it in Ubuntu first, fully anticipating the same failure as before, or at least 10 hoops that had to be jumped through before I could get it working.

But no – I was presented with a list of operators for my country (Ireland), asked if I was bill pay or pre-pay, I clicked once and I was connected!  No install required, unlike with windows, just enter your PIN and away you go.

The main argument against Ubuntu, and Linux in general, is that it doesn’t have enough driver support, making it impossible for non-computer literate people to simply plug in their devices and do what they need to do.  It’s great to see that the community is adding in new drivers at a great rate, and that things like cameras, wireless (which is also vastly improved recently) and now mobile broadband now “just work”, and in this case work much better than Windows.

My girlfriend, who is in no way interested in computers or open source, now complains about having to use Windows in university, because Ubuntu is so much easier and faster to use.  I can imagine the same story is playing out all over the world.  Hopefully at least :-)

Posted in Ubuntu, open source | Tagged: | 18 Comments »

dublinbiker iPhone site launched

Posted by Shane O'Sullivan on 26 September, 2009

A very cool bike rental scheme was launched in Dublin, Ireland this month, called dublinbikes.ie.  The one problem I have with it is that their website makes it very difficult to find a station that has bikes available when using a mobile browser.dublinbiker_screenshot

So, over a few hours last Wednesday I threw together a website, http://www.dublinbiker.com, which shows all the bike stations and how many bikes are available at each.  If you’re using a phone that has GeoLocation capabilities, it can also tell you what station is closest to you.  Clicking (or tapping) any of the stations will give you directions from wherever you are to that station.

I’ve also put a entry in my applications page at ChofterApps.

Have fun using it!

Posted in Ajax, Technical | Tagged: , | Leave a Comment »

dojo.beer() event in London, Oct 3rd

Posted by Shane O'Sullivan on 18 September, 2009

The dojo.beer() circus is coming to London!  On October 3rd 2009 Sitepen and Uxebu are hosting an all day dojo.beer() event, including talks on all things Dojo from the core committers, a bit of hacking and a lot of beer.  Not neccesarily in that order ;-)   See http://dojobeerlondon.eventbrite.com for more details.

I’m hopping over the Irish sea to join in the festivities, hope to you see you there

Posted in Dojo, Technical, open source | Leave a Comment »

Getting started with developing on the Palm Pre

Posted by Shane O'Sullivan on 16 August, 2009

This post explains how to get up and running with Palm Pre development, including getting the tools, setting up the emulator, as well as getting debugging and the inspector working.

In the last few days I’ve started playing around with the development tools for the extremely cool new phone, the Palm Pre.  The coolest thing, from a developers perspective, is that all application development is done using HTML, JavaScript and CSS.  That means if you can write a website, you can write an application for the Palm Pre (though not necessarily a good one).

However, while Palm does provide a pretty good site, http://developer.palm.com, to help you get started, it’s missing some crucial information, which is scattered all over the web (trying to find out how to do logging is a nightmare).  So, this post will explain some of the steps you need to take to get up and running.  As I prefer to use Palm’s Eclipse based development tools, this post assumes that you are using it also, and not go into the command line stuff.

1. Getting the Tools

Follow Palm’s instructions here – http://developer.palm.com/index.php?option=com_content&view=article&id=1597 , to install their tools.

I strongly encourage you to also get the Eclipse development environment, which while it is a large download, is very useful for packaging and  launching your application with a single click.  Get Eclipse by following the instructions here – http://developer.palm.com/index.php?option=com_content&view=article&id=1639 .

The Eclipse page also includes the required steps for creating a new WebOS application, adding scenes (a scene can be though of as a single web page, and you application will be made up of one or more of them) etc.

2. Create a New Scene

After following the instructions on the Eclipse page to create a new application, create a new scene clicking “File-New-Mojo Scene”, and give it the name “main”.  You should see a number of files created:

  • app/assistants/main-assistant.js – This is the JavaScript code that will be executed when your scene, or page, is rendered
  • app/views/main/main-scene.html – This is the HTML that defines the displayed HTML for the scene.
  • sources.json has also been modified to add information about your scene.

As we want the “main” scene to be displayed when the application starts, open the /app/assistants/stage-assistant.js file, and in the setup method you see there, add the following line:

this.controller.pushScene(‘main’);

That line loads your “main” scene.

3. Starting the Emulator

Palm provides a very cool phone emulator that runs on VirtualBox, which you installed earlier.  Start it by (in Windows) clicking Start > All Programs > Palm > SDK > Palm Emulator.

One thing I’ve noticed is that if you start Eclipse before starting the emulator, it throws errors and can have problems connection. So, start the emulator before Eclipse.

Sometimes you may also see an error when starting the Emulator stating that the Novacom service must be running.  To make sure it is, click Start > Settings > Control Panel > Administration Tools > Services.  Find the Palm Novacom service in the list, right click and choose start.

4. Launching the Application in Debug Mode

As you’ll pretty much always want to be viewing debug output from your application, start it in debug mode.  To do this:

  • Click Run > Debug Configurations
  • Right-Click “Mojo Application” and select “New”
  • Choose your project in the “Project” drop down box.
  • Choose the target to be “Palm Emulator”, or if you’re lucky enough to have a Palm Pre, choose Palm Device
  • Make sure to check both the Inspectable and Mojo debugging checkboxes, and click Debug.

Looking at the emulator, your application should appear.

5. Logging

Debugging with WebOS is currently a pretty nasty affair, that requires a lot of command line wizardry, that I think only a tiny percentage of people will even attempt to use (if you’ve figured it out, well done!).

However, logging is relatively simple to set up, and that’s what I use.

As with developing web applications on Firefox, you can use the Firebug function console.log to print out messages, e.g.

console.log(“the value of the input is ” + event.target.value);

So, feel free to intersperse your code with whatever logging you like.

To view the logs, you need to log into the emulator/phone remotely using Putty, a SSH client.  Luckily this is included with the Palm SDK you installed earlier.

  • Go to the bin folder in the SDK, probably in c:\program files\Palm\SDK\bin, and open putty.exe
  • In Host Name, type localhost
  • In Port, type 5522
  • Save these settings for reuse later by typing in PalmEmulator into the Saved Settings box and clicking Save.
  • Click Open.
  • When Putty prompts you for a login name, type root
  • When prompted for the password, just hit Enter, as the password is blank.
  • Now start the logging application by typing log com.mydomain.myapp. If you’re unsure of what the correct string is, open the appinfo.json file at the root of your project in Eclipse, and the right string is specified as the id in that file.

Now, when you run your application, you’ll see your console.log calls being shown there.  It’s a bit verbose, and prepends a lot before your message, but at least it’s readable.

6. Using the Inspector

Palm includes the a DOM inspector with the SDK. Before running it, and after installing your application on the emulator using Eclipse, open a command window in the SDK’s bin folder, and type

palm-launch -d tcp -i com.mydomain.myapp

once again using the correct string for your application instead of com.mydomain.myapp

Now launch the inspector by clicking Start > Programs > Palm > SDK > Palm Inspector.  The Inspector window should now launch, and display the HTML of your application.

7. Write Something Cool

I’ll leave this as an exercise to you, the good reader.  However, you should now have the ability to log messages and inspect the content of your page, so you’re almost on par with the tools available for web development (a good debugger would be nicer though).

I might write some more posts in the future covering anything cool I found or wrote for the Pre.  I’m starting to use a specialized build of the Dojo Ajax toolkit to fill in some of the blanks that Palm’s Mojo toolkit leaves out, and that’ll probably require another post.

Have fun!

Posted in Ajax, Dojo, Javascript, Technical, open source | Tagged: , | 1 Comment »

QuickSearch:Google only faster

Posted by Shane O'Sullivan on 11 August, 2009

Last week I realised that the process of searching for something on the web annoyed me -  it took too many key presses, too many clicks, and opened too many tabs.  To fix this, I came up with QuickSearch.

See the video below for a demo, or you can go to the QuickSearch Home Page to install it.

How I Search

My usual workflow is that I want to search for something but I don’t want to lose the page I’m currently looking at so I:

  • Press Ctrl-T to open a new tab
  • Press Tab to move the cursor to Firefox’s search box
  • Type in my query
  • Hit enter
  • Read through results. If I see what I want I open in a new tab in case I want to open another, if not I type in a new search and reload the search results.
  • Close the search tab.

So, I’ve opened a tab that I’ll probably only want for ten seconds, I’ve had to wait for my results until I stopped typing and loaded another page, and if I want to change my search query, I have to load the page again. Then close the search tab.

How I Want To Search

The workflow I want is

  • Press a key combination to start searching.  No new window or tab should be required.  I shouldn’t have to tab to, or click, any input box.  Since Ctrl-F is used to search within a page, I decided that Ctrl-Alt-F made a sensible key combination to search the whole web.
  • Start typing, and results should start appearing.  As I type I can keep an eye on the first one or two results, and if I see something interesting, I stop typing.
  • I click the link I want, with the option of opening the link in a new tab without having to right click it and choose that option from a menu.
  • When I’m finished using the search results, just press Esc to go back to my original page.

QuickSearch To The Rescue

I’ve implemented my desired workflow in QuickSearch, and it has really sped up my navigation around the web.

For convenience, I also added:

  • Search This Site: to search just the site you’re on, press Ctrl-Alt-S
  • Search Highlighted: to search for some term on the page, just highlight that word(s) and press Ctrl-Alt-F as normal.
  • More Results: If the quick results provided by QuickSearch still aren’t enough, and refining your query doesn’t work, you can click the “More Results” link to get many, many more results from Google, Yahoo, Microsoft and more using my search portal Chofter.com.

Cross Browser Goodness

QuickSearch works on

  • Firefox, as  a GreaseMonkey script
  • Google Chrome, as an extension
  • Every other browser as a Bookmarklet.

See the QuickSearch Home Page for installation instructions.  I think you’ll very quickly find it indespensible, especially in Firefox and Chrome where it is completely keyboard operated, no mouse required.

Fully Accessible

Another strong advantage of QuickSearch is that it is fully keyboard accessible.  No mouse is required:

  • The search is launched using keys
  • All link titles are correctly labelled
  • All search results can be navigated using the tab key
  • QuickSearch can be dismissed quickly using the Esc key.

I think users with sight impairments will especially like this.

Posted in Ajax, Javascript, Technical, search | 1 Comment »