<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.6(BH)" -->
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Planet Maemo: category &quot;feed:85141068e640087e3494790d59181094&quot;</title>
        <description>Blog entries from Maemo community</description>
        <link>http://maemo.org/news/planet-maemo/</link>
        <lastBuildDate>Sun, 24 May 2026 10:00:32 +0000</lastBuildDate>
        <generator>FeedCreator 1.7.6(BH)</generator>
        <language>en</language>
        <managingEditor>planet@maemo.org</managingEditor>
        <item>
            <title>Setting up a new development environment – Android</title>
            <link>http://makergeek.co.uk/2012/03/25/setting-up-a-new-development-environment-android/</link>
            <description><![CDATA[
<p>It&#8217;s been a long while since I was doing any personal coding projects and even longer since the last time I gave much thought to the development environment and tools that I would use. However, that time is upon me again, I&#8217;ve had an idea for an app I&#8217;d like to develop for android. Last time I developed anything it was for maemo, for the n900. Then it was a twitter client I called &#8216;witter&#8217;, and I developed it mainly as an educational thing, a modern day &#8216;hello world&#8217;. I figured it contained just the right mix of UI, and backend services integration to make for an interesting project. As it turned out, there really weren&#8217;t many twitter options on maemo at the time, and so I got quite a lot of interest from the community in what I was developing.</p>
<p>However after a while I grew tired of the n900 as a phone, whilst I loved the potential of the platform, it felt like nokia didn&#8217;t really care about it, and Android was very much the new hotness. So much more support, more apps, and generally less buggy. And so I handed over the reins to Witter development to some guys in the community that were interested in continuing to support it and I moved on. Having just had a quick look I was quite amazed to see that witter has has 318k downloads. Not bad for what started as little more than an coding exercise.</p>
<p>Back when I was developing witter I wrote about <a href="http://makergeek.co.uk/2010/01/10/setting-up-maemo-5-python-development-environment/">setting up a development environment for maemo</a>, having just googled I found it&#8217;s still in the first page of results, so hopefully it has been helpful to others, and with any luck this will be to.</p>
<p>What&#8217;s taken me so long to get around to developing again? Well I&#8217;d say the issue is two-fold, firstly I got a new job about 16 months ago and it keeps me very busy. Secondly, there are already a bazillion apps  for android. I just didn&#8217;t find the time to come up with any ideas that inspired me to get going. With little free time, it is easier to spend it on other things. (mostly wood work projects)</p>
<p>But now I have an idea, and so I started looking at what I wanted the development environment to be like. Android being Java means the IDE of choice is still eclipse, and this time I don&#8217;t have to try very hard to get things going (I recall getting the python tooling installed in eclipse was a pain). Google have made it super easy to just pickup the android developer tools update site, download and you&#8217;re ready to rock. But there is more to a dev environment than the IDE.</p>
<p>In the last year at work I&#8217;ve been using mercurial for source code and team city for continuous integration server. This is a ways on from my tool chain of maemo days, I don&#8217;t think I&#8217;d though much about using continuous integration for my personal projects. I was using SVN, but mostly that felt like a chore to make sure I had version control rather than an integrated part of the process.</p>
<p>In order to spread my experience a little, I decided to try out GIT for source and <a href="http://jenkins-ci.org/">Jenkins</a> for a CI. I did some research and found that Jenkins has an <a href="https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin">android plugin</a> that allowed it to do clever things with obtaining the android libs for compilation etc. and GIT integrated with both J<a href="https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin">enkins</a> and <a href="http://www.eclipse.org/egit/">eclipse</a> via plugins.</p>
<p>The machines I have access to at home amount to my transformer prime (which is amazing but not really suited to this kind of task), my Asrock ION 330 which runs my media centre, a netbook. and an old imac g5(ppc). there is also a main computer which my wife uses for her work, so that wasn&#8217;t really in the picture as any time I have for coding she would be spending writing. When I developed witter, I mostly used my work laptop. However it was never and ideal situation, for various reasons I&#8217;d rather keep my own projects separated completely from work. Mainly if I&#8217;m on my work laptop I&#8217;m probably logged into work and therefore distracted by work. </p>
<p>So I decided that I would install Jenkins and a main git repository on my media centre pc (it&#8217;s on all the time anyway) and install eclipse and the android developer tools on the mac. I&#8217;d not used the mac at all for a few years, it&#8217;s spent at least the last year or so packed up in its box. So I got it out, cleaned the keyboard which was quite grimy, and fired it up. Within short order I found that this being an old PPC mac, there is no download for eclipse on ppc mac. and no android developer tools either. In fact this is now a decidedly dead end of technology with very little support for it. However, ubuntu do have a ppc build, and so I figured I had nothing to lose in wiping the old os X and sticking a recent ubuntu on.</p>
<p>In the meantime I installed jenkins, then I had to figure out how to switch its default port to something else  (I already have a few web type things running on the machine so there was contention for jenkins default 8080 port). The instructions I could find appeared to point to the wrong place. in the end I wound up navigating into /etc and then:<br />
find . -name &#8220;jenkins*&#8221;<br />
Which showed me a config file : /etc/init/jenkins<br />
In here were the various settings I was looking for including the port so I made the change and started it up. In general I found the instructions for jenkins to be pretty simple and the interface to be quite self explanatory. I installed the android and git plugins via its plugin manager.  I also decided to install eclipse here along with GIT. I&#8217;m not going to be developing on my TV, but whilst the mac was undergoing longer term changes, I wanted to get a proof of concept up and running. I had a little confusion with the eclipse git plugin, since it seemed to expect each new project to be a new git repository. However you can make deal with lots of projects in a single git reop, as long as you effectively create a new project inside the git repo to start with, rather than in default workspace and then share. If the project exists inside a git repository then this is detected when you go to share the project and everything ties together nicely.</p>
<p>I decided I wanted a local repo, though much of the information on git assumes you&#8217;re going to use gitHUB to host your primary repo. I&#8217;m not sure what I&#8217;m going to do with the app yet, and I&#8217;m not comfortable making it public by default at this stage, and I&#8217;m not interested in paying for a private repo. Instead I initialized a git repo on top of my shared nas which is backed by 2 RAID-1 disks. So i figure with the primary supported on redundant discs and the nature of git being that I maintain local copies anywhere I chose to develop, it should be sufficiently protected.</p>
<p>So I have created a simple android project, and an android test project, which I have shared into a git repository. but how to get it to build? well it turns out google have even thought of this, I found some instructions that gave a command available in the ADT that inspects your eclipse project and creates an ant file to build it. Honestly this was shockingly easy.</p>
<p>Now that I had a git repo with some projects in, and a build.xml file that ant could use to compile it, I was able to configure jenkins with a build job that I configured to look at the git repo and poll every minute for changes. I added a prestep to aquire the android toolkit, and then an ant step pointing at my new build.xml. And that was it! I kicked a manual build and saw it picked everything up, compiled and created an apk file. I then made a couple of minor changes in my eclipse project and committed them, and watched as jenkins detected the changes and auto rebuilt the project. </p>
<p>So we&#8217;re in buinsess, but the iMac is not quite there yet, I got ubuntu installed, and installed eclipse, but a cursory check didn&#8217;t find the git plugin, and I fear it may not be available under the ppc version. In the meantime I used the wonder that is remote display export, and simple ssh -X to my asrock, and launch eclipse so that it displays on the iMac, it is perhaps not quite as fast as it might be running locally, but it does sidestep  entirely the issues of the ppc versus x86 architectures.</p>
<p>Next I need to figure out how to get the apk file published somewhere that my tablet and my phone can pick it up to install.</p>
<p>Its interesting to see how easy most of this stuff is now. Also it probably says something about me, that having had an idea of what I want to develop, before  I really do anything specific to that, what I wanted was source control and continuous integration in place. Next I will make sure that I have a test project running and able to run tests against the code. This is something I didn&#8217;t bother with when I wrote witter, and I really should have. The danger being that once I&#8217;d gotten a certain way without tests, it felt like it would be too much time spent not making progress on the app to go back and add them. Of course me being a software tester I really should know better, but  I figured it was just a coding exercise, I was just learning, it wasn&#8217;t &#8216;real&#8217; development, until it was, and I was in a mess.</p>
<p>So this time I&#8217;m learning from those mistakes. I want the process for writing tests, building and running tests, and deploying to my devices to be worked out and slick before I even start to think about implementation of the app.</p>
<p>I&#8217;m sure I&#8217;ll post again as I learn more about the challenges of developing for android.</p><br />Filed under: <a href='http://makergeek.co.uk/category/android-2/'>Android</a>, <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/project/'>project</a>, <a href='http://makergeek.co.uk/category/softwareengineering/'>SoftwareEngineering</a> Tagged: <a href='http://makergeek.co.uk/tag/android/'>android</a>, <a href='http://makergeek.co.uk/tag/development/'>development</a>, <a href='http://makergeek.co.uk/tag/eclipe/'>eclipe</a>, <a href='http://makergeek.co.uk/tag/git/'>git</a>, <a href='http://makergeek.co.uk/tag/imac-g5/'>imac g5</a>, <a href='http://makergeek.co.uk/tag/jenkins/'>jenkins</a>, <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/ppc/'>ppc</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/1254/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=1254&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">3 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=56417d1e768711e189cef12844dc6a4b6a4b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/56417d1e768711e189cef12844dc6a4b6a4b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=56417d1e768711e189cef12844dc6a4b6a4b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/56417d1e768711e189cef12844dc6a4b6a4b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sun, 25 Mar 2012 14:03:48 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-56417d1e768711e189cef12844dc6a4b6a4b</guid>
        </item>
        <item>
            <title>Maemo: n900  to Android: HTC Desire Z</title>
            <link>http://makergeek.co.uk/2010/11/14/maemon900-to-android-htc-desire-z/</link>
            <description><![CDATA[
<p>I had toyed with the idea for a while, and even written a post some time ago suggesting that my next phone would like be an Android one. A couple of weeks ago my n900 decided to stop booting at all, and I had to send it away for repair. While it was away I borrowed a G1 from a friend, and got to spend a week with it.</p>
<p>Well Android made such a good impression that I wound up buying the new <a href="http://www.htc.com/www/product/desirez/overview.html">HTC Desire Z</a> before my n900 returned from being repaired.</p>
<p>I just re-read the <a href="http://danielwould.wordpress.com/2009/11/28/my-new-n900/">post</a> I had written after 1 week of owning the n900, and I am reminded of what a great impression I had of it at that point. I had previously used an e71 as just a feature phone, and an n810 for my mobile computing/browsing, etc. The n900 really sold me on smartphones, and the idea of a one stop device where previously I&#8217;d had two. It was a compromise of screen size, but the benefit of built-in, always-on data connection and only having to carry and charge one device won me over.</p>
<p>Compared to my previous experience of phone and tablet, the n900 felt fast and capable; I was very happy. Interesting then that clearly the weight of time really slowed things down. Recently I&#8217;d been increasingly frustrated by receiving phone calls. Something I mentioned in my previous post anticipating a future move to Android. Receiving a call, particularly when you have left some things running, could be a painful, slow experience: waiting for the screen to redraw itself enough to react to answering the call.</p>
<p>The openness of Maemo is its great appeal, but I also feel its great downfall. No architecture or structure for apps to follow in order to be &#8216;good citizens&#8217; on the phone, no mechanism for developers to get feedback on installed instances, errors occurrences, etc.<br />
The openness of Maemo had great potential, but one year on and I don&#8217;t feel like it gained the kind of commercial support required to realise that potential. When I first started Witter, my own Twitter client, it was in response to not liking the only other option at that time. And I intended it as a programming exercise: a little fun. I never envisaged that one year on there would still be no serious professional app to replace it. There are now a couple of additional options, and I&#8217;m not knocking them, but they are fundamentally much like mine: a few guys having some fun and doing the best they can around their real lives, not a company creating a product.</p>
<p>And so to Android.</p>
<p>I&#8217;m conscious that after one week my n900 still felt snappy and amazing. So the only truly fair test is to see what I think of Android, and the Desire Z in a few months. But after a week with a g1, and now a week with my own Desire Z, I love Android, and I love my new phone.</p>
<p>The keyboard on the Desire Z is very nice, nicer than the N900 as it is a little larger, and the spaces between the keys make things a little more comfortable. Plus the on-screen keyboard is very usable in Android. I still like to have the physical option, but the ability to do some limited entry on-screen is good, and its ability to smooth out my mistypings into the words I meant makes it something I use in more circumstances than I thought. The n900 never got a portrait-mode keyboard, and in landscape there was no point, just open the real keyboard.</p>
<p>It&#8217;s probably unfair to compare the speed of the Desire Z to the n900, both because &#8216;fresh&#8217; versus several months in is unfair. Also, of course, the Desire Z is a brand new phone, with a faster processor and the latest tech; the n900 is now 1 year old. Interestingly though, I really liked the experience I got on the g1 which was older than the n900.</p>
<p>Android feels very polished, the phone capability (so far) has been fast and apparently unfazed by what I may have tried running. The integration with Google is cool since I do use Google stuff. That said I have a Google apps account, not a gmail account. This subtlety trips up a few things, Google seem to frequently bring out sexy new services that don&#8217;t work with their apps accounts. But generally all the integration I loved from the n900 is so much better/fuller in Android: Calendar, mail, contacts, and also the built in linking of Google, Facebook, and Twitter contacts. These things could be done on the n900, but not so easily or natively.</p>
<p>The camera, a feature I was very impressed by on my n900, has all of the features I loved there and more. The camera app is faster, picture taking is quicker, and there are a bunch of interesting options and effects that can be applied. The camera software on the Desire Z does face detection which is cool, but I particularly like the depth of field effect. The images seem better to me, though it is still only 5MP. One thing I have noticed is that it is hard to use the physical camera button without moving the camera and causing a blurred shot. However, tapping the on screen button is fine.</p>
<p>As a piece of hardware, the location of the ports makes much more sense than on the n900. The mini USB is on the bottom if held landscape, i.e. it suits a landscape docking station, which is something I will most likely buy. The headphone jack is on the top in portrait mode.<br />
On the n900 the USB socket was on the top in portrait, and the headphone socket was on the bottom: this didn&#8217;t really suit any dock, and didn&#8217;t make much sense as a layout.</p>
<p>The Desire Z being an HTC phone they have the &#8216;sense UI&#8217; on top of stock Android. So far I really like it. I love the big clock/weather app that is so distinctive of the Sense UI. Generally, I like all of the HTC specific bits and bobs. I guess my only complaint is that there are some duplications which aren&#8217;t obvious, for example,  HTC&#8217;s peep Twitter client and the official Twitter client both came installed. HTC have some nice locations stuff, with off-line maps for GPS that sit along side Google maps. It wasn&#8217;t immediately clear that there were different things here with different map sources, but I&#8217;m getting used to it. HTC&#8217;s navigation stuff appears to have &#8216;premium navigation&#8217;, which indicates I would need to pay for something after 30 days. I&#8217;m not yet sure whether that means all navigation in their off-line maps, or just some elements of it. Given that Google navigation exists, and the only trade off is the need for a data connection, I&#8217;m not sure what price point would convince me to pay for HTC&#8217;s &#8216;premium&#8217;.</p>
<p>I know I&#8217;m trading really open and flexible, for &#8216;mainstream&#8217; and less open. Android is open to a point, but if I wanted to install a new OS on the phone I&#8217;d have to do some dodgy things. Also if I wanted a command line to handle files at a lower level, rather than be restricted in what formats I can use, then I would have to jump through some hoops. However the only reason I was interested in installing a new OS on the n900 was because Maemo was so lacking in the mainstream conveniences. Basically I used the openness to install Android on the n900. A great project with real potential, but at the end of the day the draw was Android, not a phone capable of multi-boot.</p>
<p>I will be starting my new job soon, and there I will return to the world of Windows after several years running Ubuntu on my work laptop. I suspect I will find some things very frustrating, but I consider this move an experiment in going mainstream for a while;yo  see how the other half live. Maybe I&#8217;ll try buying DRM&#8217;d Kindle books, or Audible audio books. I&#8217;ll pay for apps and see if I get a better product than the many (very good) open source applications around. Maybe I&#8217;ll be driven mad by the closed nature (I&#8217;m pretty certain Windows will bug me) but I can&#8217;t say that everything has been sunshine and roses in the world of completely open. I&#8217;ve spent a lot of my time learning how to do things, work around issues, hack this and that. I&#8217;ve spent a *huge* amount of time writing Witter, to very mixed response. Many have been grateful and happy, but a number have been decidedly ungrateful and I have often wondered why I bothered giving it away at all, I could have just kept it to myself.</p>
<p>I may end up developing for Android, but only if there aren’t already apps that do what I want.</p>
<p>This is the first non-Nokia phone I&#8217;ve ever owned. Back in the feature phone days, there was just no competition. Now, for smart phones, my experience with Android and HTC makes me think I won&#8217;t be going back to Nokia any time soon.</p><br />Filed under: <a href='http://makergeek.co.uk/category/android-2/'>Android</a>, <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/thoughts/'>Thoughts</a> Tagged: <a href='http://makergeek.co.uk/tag/android/'>android</a>, <a href='http://makergeek.co.uk/tag/desire-z/'>Desire Z</a>, <a href='http://makergeek.co.uk/tag/htc/'>HTC</a>, <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/n900/'>N900</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/935/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=935&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=b268eb32f00411dfb5fbdf13a52e2a7c2a7c&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/b268eb32f00411dfb5fbdf13a52e2a7c2a7c/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=b268eb32f00411dfb5fbdf13a52e2a7c2a7c&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/b268eb32f00411dfb5fbdf13a52e2a7c2a7c/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sun, 14 Nov 2010 14:34:43 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-b268eb32f00411dfb5fbdf13a52e2a7c2a7c</guid>
        </item>
        <item>
            <title>Maemo Application repository – A suggestion</title>
            <link>http://makergeek.co.uk/2010/08/14/maemo-application-repository-a-suggestion/</link>
            <description><![CDATA[
<p>One of the things which I like about Maemo is the way they arrange an application repository structure go with a development cycle of an app.</p>
<p>Rather than simply writing something, and making it available in an appstore when you&#8217;ve made it &#8216;perfect&#8217; there is a tiered structure. </p>
<p>The structure has 3 layers, at the top there is &#8216;extras&#8217; this is the main application repository, it comes enabled by default, and can be considered similar to an appstore (except the apps are all free) The things here are finished or at least considered to be consumer ready applications.</p>
<p>Beneath this there is extras-testing, and below that extras-devel. It&#8217;s a sensible idea, as a developer the first thing you can do is submit your application to extras-devel, from here you can try installing the app through the real mechanism, check that things are basically working and generally use it as a staging ground to try new things.</p>
<p>Once happy with a version of your app, you get the chance to &#8216;promote&#8217; the application from the development repository to the testing repository. The community is encouraged to get involved with apps from the testing repository, and provide feedback to the developer about any bugs found. The community gets to vote on versions in the testing repository to show whether they think the app is basically ready for general availability in the extras repository. The rules around this are that the app is stable, does as it claims to, and all the relevant info is provided, such as a bug tracker where people can raise defects. This does not mean the app is *good* just that it works as described with no nasty side effects.</p>
<p>I really like this idea, and as a developer can see the value beyond just being left to make an application available to everyone with no differentiation of stable/finished versus unstable in development.</p>
<p>However, there is a gaping flaw in the way this is all implemented on the device.</p>
<p>Most people, shortly after getting the phone, find out that a bunch of cool apps exist in extras-testing, that aren&#8217;t in extras yet. They accept the warnings and go enable it.</p>
<p>Then they realise that all the bleeding edge cool on one particular app they love is in extras-devel. They ignore the severe warnings about the potential to brick their device and enable extras-devel to install the latest of their beloved app. And it&#8217;s great! this app works just fine in devel and they get the newest features quickly. Before you know it they aren&#8217;t disabling the extras-devel repository any more.</p>
<p>But the application manager doesn&#8217;t really differentiate when showing updates, which repo they are from. Sure, you can find out, but it just shows a list of updates and an &#8216;update all&#8217; button. So all those people just pick up the latest versions, forgetting that these are all from devel. They should just &#8216;remember&#8217; to disable it again. However I think it would be nicer if there was a persistent visual indicator, and a much more obvious way to chose which apps you are prepared to update from which repository. The reality is that people don&#8217;t remember, so in the interests of usability I think there should be a better way.</p>
<p>I discussed this on twitter with @benjezzy who suggested a simple red/amber/green identifier to show which repository this update is from. I think something like that could work. What I&#8217;d really like is in the update panel to see what version I have right now, and which repository I installed it from, and which repository the upgrade is available in. Along with the option to say &#8216;notify when in extras&#8217; or extras-testing etc. all  per app. There are some apps I&#8217;m happy with, they do what I need, and I would be happy to just pick up mature changes from extras. There are others that are in early development, rapidly changing and marching towards being awesome, and I&#8217;d like to track that progress more closely picking up frequent updates. I guess it often boils down to the apps I use daily, I want stability. Those which are just cool toys, but less frequent use, I want to try every new update, and it won&#8217;t effect me too much if there are some backward steps.</p>
<p>Speaking for my self, and witter. I use devel to try stuff and get some valuable feedback from a hardcore few who (hopefully) don&#8217;t judge me too harshly when I break it, or introduce massive regressions. But every time I do this, I get comments from others who complain it&#8217;s just &#8216;stopped working&#8217; or  react as if they think a given change is final. I&#8217;d rather these people return to the safety of extras-testing, which I at least try not to break. I promote stuff here when it is in at least reasonable final form. I don&#8217;t want to turn off users with a feeling that witter is unstable, but I do want a place to let some people try early attempts before I get too far along implementing something.</p>
<p>Other more conscientious developers may deliver perfect updates to extras-devel, and just be frustrated by how long it takes them to push their awesome code through the system to extras, and I don&#8217;t want general users not to be able to get those updates quickly and easily. But they should be able to make this choice easily on a per app basis.</p>
<p>Of course Maemo is basically dead now, and the new meego taking it&#8217;s place. I&#8217;ve not played at all with meego, but assuming it will inherit some of these concepts, perhaps they can look to make some improvements here, I really think the tiered repository is a good idea (for developers like me) and with a few tweaks could avoid frustration from users getting instability they weren&#8217;t expecting, and developers getting complaints based on mismatched expectations.</p>
<p>To those that do live dangerously, and take the latest, half baked updated from Witter, and manage to provide constructive feedback. Thank you.</p><br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/thoughts/'>Thoughts</a> Tagged: <a href='http://makergeek.co.uk/tag/extras-devel/'>extras-devel</a>, <a href='http://makergeek.co.uk/tag/extras-testing/'>extras-testing</a>, <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/meego/'>meego</a>, <a href='http://makergeek.co.uk/tag/repositories/'>repositories</a>, <a href='http://makergeek.co.uk/tag/tiered/'>tiered</a>, <a href='http://makergeek.co.uk/tag/usability/'>usability</a>, <a href='http://makergeek.co.uk/tag/witter/'>witter</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/895/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=895&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">15 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=35a028eca7a011df94543f2114039b889b88&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/35a028eca7a011df94543f2114039b889b88/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=35a028eca7a011df94543f2114039b889b88&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/35a028eca7a011df94543f2114039b889b88/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 14 Aug 2010 12:30:58 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-35a028eca7a011df94543f2114039b889b88</guid>
        </item>
        <item>
            <title>Autonomy, mastery, purpose</title>
            <link>http://makergeek.co.uk/2010/06/26/autonomy-mastery-purpose/</link>
            <description><![CDATA[
<p>I recently watched a really interesting you tube video about <a href="http://www.youtube.com/watch?v=u6XAPnuFjJc&amp;feature=PlayList&amp;p=40810FA0BFEDFF3D&amp;playnext_from=PL&amp;playnext=1&amp;index=68">drive</a>. Eg that which motivates us.<br />
It&#8217;s really interesting in two ways. Firstly the content is interesting to me, as it pertains to things that motivate people and what generally makes people happy in work.<br />
The second, is that the style of the video is fantastic, it&#8217;s basically a lecture which has been put to an animation of drawing on a whiteboard, drawing pictures and words that go with what is being said. I really love this idea and it makes for a great video. So if you got this far without clicking on the link, go spent the next 10 minutes watching. It&#8217;s ok. I&#8217;ll wait.</p>
<p>Good huh? It really struck a chord with me, about the sorts of things I chose to do and the things I find fun. He talks about people with full time paid jobs doing technical work, that for some reason chose to spend their own discretionary time working on other technical projects, that they give away for <strong>FREE</strong>. In my case that is Witter my twitter client.</p>
<p>Why did I start Witter? <em><strong>Purpose</strong></em>. The existing client for maemo had a particular behaviour, which I considered a bug, and it happened to me just a few times too often, and so I decided that I would start developing my own client, whose main purpose would be to not have that bug.<br />
Later that purpose became &#8216;to be the most fully featured twitter client available for maemo&#8217;</p>
<p>What&#8217;s kept me at it? <em><strong>Autonomy</strong></em> and <em><strong>mastery</strong></em>. I call my own shots, I develop what features I want, in the order I want. Sure I listen to what users are asking for, but at the end of day, I do what I feel like doing. I also set out to learn Python, to figure out how to make a UI (even though most would say I have a LONG way to go on that one) but I get that enjoyment of figuring stuff out, and getting better at it.<br />
I would be tempted to sell it, if the option existed. I do have a donation mechanism whereby people that appreciate it can buy me a beer. But even if I were selling it, money would not really be the motivator, there is simply no way I could make enough from developing witter to be in any way &#8216;worth&#8217; the amount of time I&#8217;ve spent on it. As it stands I have had, I think, 7 donations. Which, considering witter sits just 6 shy of 50,000 downloads at time of writing, Is not a high user to donation ration <span class='wp-smiley wp-emoji wp-emoji-wink' title=';-)'>;-)</span> (to be fair I think that 50k is about 1000 people downloading 50 versions)</p>
<p>Sometimes when I read complaints about what witter doesn&#8217;t do, or what bug/feature really annoys someone, it makes me question why they hell I spent so many hours on this thing which I give away, if there are still people that just complain about it. Perhaps I&#8217;m a sensitive soul, but it only takes 1 complainer to wipe away 20 compliments,(but thanks still to those who are appreciative and complimentary). None the less my motivations are clearly not money, nor the universal praise it draws. However I do get to do what I want, learn new skills, and drive towards a goal that I think is worthy.</p>
<p>All this makes me think that I should start identifying these possibilities in the opportunities I&#8217;m presented with, as I believe it will help me better determine things that I will enjoy doing.</p>
<p><em><strong>What motivates you</strong></em>?</p><br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/thoughts/'>Thoughts</a> Tagged: <a href='http://makergeek.co.uk/tag/autonomy/'>autonomy</a>, <a href='http://makergeek.co.uk/tag/drive/'>drive</a>, <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/mastry/'>mastry</a>, <a href='http://makergeek.co.uk/tag/motivation/'>motivation</a>, <a href='http://makergeek.co.uk/tag/open-source-development/'>open source development</a>, <a href='http://makergeek.co.uk/tag/purpose/'>purpose</a>, <a href='http://makergeek.co.uk/tag/witter/'>witter</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/859/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/859/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=859&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">11 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=f446b606811e11df9a647b15006d4c364c36&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/f446b606811e11df9a647b15006d4c364c36/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=f446b606811e11df9a647b15006d4c364c36&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/f446b606811e11df9a647b15006d4c364c36/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 26 Jun 2010 12:00:52 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-f446b606811e11df9a647b15006d4c364c36</guid>
        </item>
        <item>
            <title>N900 portrait keyboard for Witter</title>
            <link>http://makergeek.co.uk/2010/06/05/n900-portrait-keyboard-for-witter/</link>
            <description><![CDATA[
<p>Recently Nokia released the much awaited pr 1.2 firmware for the N900, and among the many bug fixes and tweaks, came the ability to easily rotate applications to portrait by hitting ctrl+shift+r, then closing the keyboard and rotating to portrait. This feature had the knock on effect that I started to look seriously at portrait support in Witter, where upon I quickly found a pre-canned python module that I could just include to get persistent portrait support available from the <a href="http://talk.maemo.org/showthread.php?t=31940">talk.maemo.org forums</a></p>
<p>No sooner had I got witter in portrait mode, than the obvious next step was suggested&#8230;. what about some way to actually tweet in portrait. For those not familiar with Maemo and the N900, although it does now support some appliactions such as the browser going portrait, there is no system wide on screen keyboard for portrait use. There is one for landscape (despite having a physical keyboard for landscape use) but not in portrait. this has left application developers to provide their own. This is deeply dissatisfying as an approach, however keen to provide a meaningful portrait use for Witter, I decided to go ahead and implement my own.</p>
<p>So how to go about it? Well it actually not very hard at all, just very boring. Basically a &#8216;keyboard&#8217; is just a bunch of buttons, all wired to emit a signal with a single letter, number or symbol associated. So that&#8217;s 26 button definitions, 3 lines per definition (create object, set title, connect signal to emit character) just to do all the lower case letters. So far that&#8217;s a little under 600 lines of code, to provide upper and lower case letters, plus a keyboard with numbers and some of the more obvious symbols, plus some mode shifting buttons. Most of this is of course copy&#8217;n&#8217;paste work, with single character adjustments but in a desire to not have generic and confusing object names I also had to name all of them appropriately. In all it was a couple of hours work.</p>
<p>The implementation is a fairly simple architecture, The main witter layout has a single gtk.VBox which is the main contained for the keyboard. It defaults to empty and invisible.<br />
Each keyboard layout comes with two methods, one to define all the objects, and a wrapper which calls it then requests that the gtk.VBox and all it&#8217;s children become visible. This is separated into two because it is helpful to be able to initialise the keyboard objects separately from choosing whether they should currently be visible or not. The main definition method starts by destroying everything already inside the top level gtk.VBox. This means each layout can have a different number of rows as wells as different content in them.</p>
<p>Each button is created like this:<br />
<span style="color:#000080;">q = hildon.Button(gtk.HILDON_SIZE_FINGER_HEIGHT,<br />
hildon.BUTTON_ARRANGEMENT_VERTICAL)<br />
q.set_title(&#8216;q&#8217;)<br />
q.connect(&#8220;clicked&#8221;, self.TypeLetter, &#8220;q&#8221;)</span></p>
<p>The interesting code actually occurs in TypeLetter, because there are a few subtle behaviours that people expect from a text entry field that aren&#8217;t that obvious. For instance you want to be able to select any point in the existing string, and enter or delete text from that point, not just add characters onto the end.</p>
<p><code> </code></p>
<pre><span style="color:#000080;">def TypeLetter(self, widget,  letter):</span>
    <span style="color:#00ff00;">#get the position of the current cursor</span>
    <span style="color:#000080;">pos = self.tweetText.get_position()</span>
    <span style="color:#00ff00;">#get the current text string</span>
    <span style="color:#000080;">text = self.tweetText.get_text()</span>
    <span style="color:#00ff00;">#if passed special delete eye catcher we are actually deleteing characters</span>
    <span style="color:#000080;">if (letter =="*delete*"):

        self.tweetText.set_text(text[0:pos-1]+text[pos:len(text)])
        self.setCursorAt(pos-1);
    else:</span>
        <span style="color:#00ff00;">#normal entry of text at the selected pos</span>
        <span style="color:#000080;">self.tweetText.set_text(text[0:pos]+letter+text[pos:len(text)])
        self.setCursorAt(pos+1);</span>
</pre>
<p>So you have to basically split the existing string around the position of the cursor and either insert or delete characters at that point, and leave the cursor set in the appropriate position.</p>
<p>All of this goes to make a keyboard that looks something like this:</p>
<p><img class="alignnone" title="Witter portrait keyboard" src="http://farm5.static.flickr.com/4044/4665363335_08e3c7911b_b.jpg" alt="" width="480" height="800" /></p>
<p>The remaining question is how to launch the keyboard when you want it. At the moment in Witter I have re-purposed a PLUS icon in the top row of buttons, so that in portrait mode it displays or hides the portrait keyboard. (whenever the orientation changes I store a current orientation value so that this code can tell whether it should be displaying the portrait keyboard or not) However ideally it would be hooked off of the text entry field gaining or losing focus, I just haven&#8217;t figured that bit out yet.</p><br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/softwareengineering/'>SoftwareEngineering</a>, <a href='http://makergeek.co.uk/category/top-tip/'>top tip</a> Tagged: <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/on-screen-keyboard/'>on screen keyboard</a>, <a href='http://makergeek.co.uk/tag/portrait/'>portrait</a>, <a href='http://makergeek.co.uk/tag/python/'>Python</a>, <a href='http://makergeek.co.uk/tag/witter/'>witter</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/837/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=837&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">4 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=be47b6a8709e11dfabfafb33048034433443&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/be47b6a8709e11dfabfafb33048034433443/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=be47b6a8709e11dfabfafb33048034433443&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/be47b6a8709e11dfabfafb33048034433443/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 05 Jun 2010 12:07:50 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-be47b6a8709e11dfabfafb33048034433443</guid>
        </item>
        <item>
            <title>N900 IM style notifications from python</title>
            <link>http://makergeek.co.uk/2010/05/22/n900-im-style-notifications-from-python/</link>
            <description><![CDATA[
<p>In the last couple of days I&#8217;ve spent several hours trawling the internet in search of an example of something I hoped would be fairly easy. How to trigger an IM/Email type notification event from python. Many people have asked that Witter do these style of notifications when a mention or DM is received. But how to do them? I had been using:<br />
<span style="color:#0000ff;">note = osso.SystemNote(self.osso_c)<br />
result = note.system_note_infoprint(str(receive_count) + &#8221; Tweets Received&#8221;)</span><br />
to display a banner, but I could find nothing that would point me towards the style which flashes the corner menu button and shows up in the task switcher until dismissed.</p>
<p>After a great deal of digging, I discovered pynotify and the syntax to do what I wanted<br />
<span style="color:#0000ff;">n = pynotify.Notification(&#8220;Witter&#8221;,&#8221;You have &#8220;+str(receive_count)+&#8221; new mentions&#8221;)<br />
n.set_urgency(pynotify.URGENCY_CRITICAL)<br />
n.show()</span></p>
<p>This is very cool but only part of the job, as doing this does not also flash the led, or vibrate, or play a sound. I had perhaps foolishly assumed there were a combination of the same thing, an alert, but no, I have to figure them out separately.</p>
<p>First job was led flashing, and it was not simple. There are plenty of posts about manipulating the patterns being used by the n900 already, but it took me some time to find a page which showed the dbus commands that trigger the actual event. That said at time of writing I can&#8217;t find that page again, even though I now know more of what I&#8217;m looking for. the command to use from x-terminal is<br />
<span style="color:#0000ff;">dbus-send &#8211;system &#8211;type=method_call &#8211;dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:PatternCommunicationIM</span></p>
<p>Simply putting deactivate instead of activate turns it off again.<br />
Ok so having gotten this far, all I needed to do is figure out how to send that signal from python&#8230;.easy right?</p>
<p>I could not for the life of me find any example of using dbus like this, it took me ages to figure out that I needed to use rpc.rppc_run to send the request, and then the only examples I could find were for simple toggles of one mode functions, that is nothing that passed parameters such as the pattern to use. I got to the point where the code ran ok, but was clearly not passing the information required to actually turn the pattern on.</p>
<p>To cut an already long story short, I basically got down to trial and error throwing combinations of probable looking options as the rpc_run command, once I had found the rpc_args parameter, I still had to figure out quite what format to use, the command line example had string:PatternCommunicationIM, was the &#8216;string:&#8217; value important? how to specify? I tried a bunch of stuff, originally just passing PatternCommunicationIM as a string, and getting errors about parameters needing to be a tuple. Ultimately I guessed, and just chucked some empty strings after the string I wanted to pass&#8230; and finally this is how to do it</p>
<p>I have the following static strings defined:<br />
<span style="color:#0000ff;">_MCE_SERVICE = &#8216;com.nokia.mce&#8217;<br />
_MCE_REQUEST_PATH = &#8216;/com/nokia/mce/request&#8217;<br />
_MCE_REQUEST_IF = &#8216;com.nokia.mce.request&#8217;<br />
_ENABLE_LED = &#8216;req_led_pattern_activate&#8217;<br />
_DISABLE_LED = &#8216;req_led_pattern_deactivate&#8217;<br />
_VIBRATE  = &#8216;req_vibrator_pattern_activate&#8217;<br />
_VIBRATE_PATTERN= &#8216;PatternChatAndEmail&#8217;<br />
_LED_PATTERN = &#8216;PatternCommunicationIM&#8217;</span></p>
<p><span style="color:#0000ff;">then these 3 lines enable the led and trigger a vibration:</span></p>
<p><span style="color:#0000ff;">rpc = osso.Rpc(self.osso_c)<br />
rpc.rpc_run(self._MCE_SERVICE, self._MCE_REQUEST_PATH,self._MCE_REQUEST_IF,self._ENABLE_LED,rpc_args=(self._LED_PATTERN,&#8221;&#8221;,&#8221;&#8221;),use_system_bus=True)<br />
rpc.rpc_run(self._MCE_SERVICE, self._MCE_REQUEST_PATH,self._MCE_REQUEST_IF,self._VIBRATE,rpc_args=(self._VIBRATE_PATTERN,&#8221;&#8221;,&#8221;&#8221;),use_system_bus=True)</span></p>
<p>All in all it&#8217;s not that hard, there is not much code there. If I wasn&#8217;t defining the strings as constants then it would literally be 3 lines of code to set the LED and vibrate. I thought I&#8217;d have to use a callback to turn the LED pattern off again, but it turns out it does that automatically when I click on the event. Which is just as well because I haven&#8217;t gotten the callback to work yet. so at the moment clicking on the event just dismisses it, it doesn&#8217;t take you to the appropriate view in witter (like an e-mail event does) However I thought this was worth sharing in the hopes that anyone else that wants to do this kind of even notification doesn&#8217;t have to go through the same pain as me trying to figure it out.</p><br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/top-tip/'>top tip</a> Tagged: <a href='http://makergeek.co.uk/tag/blink-led/'>blink LED</a>, <a href='http://makergeek.co.uk/tag/dbus/'>dbus</a>, <a href='http://makergeek.co.uk/tag/im-alert/'>IM alert</a>, <a href='http://makergeek.co.uk/tag/led-pattern/'>led pattern</a>, <a href='http://makergeek.co.uk/tag/notification/'>Notification</a>, <a href='http://makergeek.co.uk/tag/pynotify/'>pynotify</a>, <a href='http://makergeek.co.uk/tag/python/'>Python</a>, <a href='http://makergeek.co.uk/tag/vibrate/'>vibrate</a>, <a href='http://makergeek.co.uk/tag/witter/'>witter</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/820/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/820/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=820&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">18 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=abf23c62659511dfbe2bd9bb954269496949&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/abf23c62659511dfbe2bd9bb954269496949/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=abf23c62659511dfbe2bd9bb954269496949&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/abf23c62659511dfbe2bd9bb954269496949/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 22 May 2010 11:11:44 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-abf23c62659511dfbe2bd9bb954269496949</guid>
        </item>
        <item>
            <title>Why my next smartphone will probably be running Android – confessions of a Nokia fanboy</title>
            <link>http://makergeek.co.uk/2010/04/02/why-my-next-smartphone-will-probably-be-running-android-confessions-of-a-nokia-fanboy/</link>
            <description><![CDATA[
<p>It&#8217;s no secret I am a huge fan of <a href="http://nokia.com">Nokia</a> phones. Every mobile I&#8217;ve ever owned has been a Nokia, for over a decade no other manufacturer has come close when I&#8217;ve looked for my next phone.</p>
<p>A couple of years ago I got a Nokia 770 internet tablet and really started to get into mobile computing. My upgrade to the n810 was great and just further cemented my addiction to having some serious computing power with me wherever I went.<br />
Most recently Nokia release the N900 which changed direction a little from the Maemo devices before it. Being a smartphone, it is smaller than the internet tablets and seeks to be the &#8216;all-in-one&#8217; device. To allow you to leave behind the laptop, tablet, mp3 player, camera etc and just carry one device. A phone which does it all.</p>
<p>To be honest I was a little unconvinced, when I first bought a tablet it was cheap (who can resist a touch screen computer for £75!), when I got the n810 it was in stiff competition with a netbook. I was balancing more power over truely mobile. With the n900 I wasn&#8217;t sure that something small enough to be a phone could meet my needs for mobile computing.<br />
<img class="alignleft" src="http://c5.img.digitalriver.com/gtimages/store-mc-uri/nokia/assets/local/en-GB/product_images/10208380.jpg" alt="" width="258" height="311" /><br />
But with the N900 they have convinced me. This is the one device I need, it is with me everywhere, it is always on line. It&#8217;s a camera when I need one, a gps device in the car, my music player, I write this blog from it, read the news, download and listen to podcasts, the list goes on and on and on.</p>
<p><img src="http://static.maemo.org/style_maemo2009/img/maemo.jpg" alt="" /><br />
But&#8230;</p>
<p>Because of this success Nokia have opened my eyes to the world of smartphones, and there is serious competition.<br />
As a long time linux zealot, I would not consider another Microsoft OS on anything I own, so windows mobile is out.<br />
<img class="alignright" src="http://upload.wikimedia.org/wikipedia/en/thumb/a/ab/Apple-logo.png/140px-Apple-logo.png" alt="" width="140" height="171" /></p>
<p>I also can&#8217;t bring myself to buy into the locked down eco-system of the iP* selection. They look great, work great, and hold not inconsiderable appeal, but they don&#8217;t play well with others, and Apple want to control what you do and how you do it. I understand their reasons for doing so, but I like enough freedom to get myself into trouble.</p>
<p>Which brings me to Android.<br />
<img class="alignleft" style="width:200px;height:150px;" src="http://www.android.com/media/wallpaper/thumbs/android_logo.gif" alt="" width="200" height="150" /></p>
<p>No it&#8217;s not as open as <a href="http://maemo.org">Maemo</a>. Yes I&#8217;m restricted in quite what I can implement on the device, and in what language. But I think a little control on a smartphone is probably a good thing. Some reuqirements that force apps to be good citezens when an actual phone call needs to happen and resources must be diverted seems like a sensible architecture.  My N900 can really struggle to bring up the phone &#8216;app&#8217; when someone calls me, if I&#8217;m busy in half a dozen running apps. I&#8217;d actually rather have more structure and requirements on me as an app developer, if the benefit is knowing the app will play nice with everything else that needs to happen on a phone.</p>
<p>But none of this is why I really think I&#8217;ll be switching.</p>
<p>It all boils down to business models, and what the implications of those business models are for me.</p>
<p><img class="alignleft" style="width:80px;height:80px;" src="http://t0.gstatic.com/images?q=tbn%3Atcsk62npEoPrSM%3Awww.hightechideas.com%2Fwp-content%2Fuploads%2F2009%2F08%2Fnokia-logo.jpg&amp;h=80&amp;w=80&amp;usg=AFrqEzf9TKuKx8r9dMkiIVKRwRs9BJ-5Dg" alt="" width="80" height="80" /><br />
You see, Nokia make money when I buy their phones. But that&#8217;s all. Sure ovi store is theoretically coming and they will take a slice, but right now they have little incentive to improve my experience on this device. They have made their money, their only motivation from now is to convince me to buy the next device.</p>
<p><img class="alignleft" src="http://upload.wikimedia.org/wikipedia/en/thumb/a/ab/Apple-logo.png/140px-Apple-logo.png" alt="" width="84" height="103" /></p>
<p>Apple makes money when I buy the device, and when I buy apps &amp; music for it. So iTunes gets massively updated. It&#8217;s apparently a great app, and of course it is. This is how Apple continue to make money from you, it is in their interests for you to want to use it, to find it intuitive and easy.<br />
But at some point, they are ultimately in the hardware business. They need you to buy the next device, they lock you in to their eco-system to make it harder for you to switch away on your next purchase.</p>
<p><img src="http://t0.gstatic.com/images?q=tbn%3A64ozHMzIweLUvM%3Awww.doobybrain.com%2Fwp-content%2Fuploads%2F2008%2F01%2Fgoogle-logo.gif&amp;h=52&amp;w=136&amp;usg=AFrqEzeem9hhARuecdQBfO94MEfziQ-sKA" alt="" /><br />
Google don&#8217;t need to make money selling phones. The money they make from you buying a Nexus one is insignificant compared to the money they make from you *using* that phone to access their services. This is why lots of people sell android phones, Google care that you use android, not that you buy hardware. This is because Google make money through advertising. The smarter they can do that, the happier everyone is, you get relevant adds, advertisers get more bang for the buck. The fact is, companies pay google lots of money to show you adds whilst you use their service. It is in googles interest for you to *want* to use their phones, and so they have cool and interesting technology in them. The more you use it, the more you wind up using their services, the more other people pay them.</p>
<p>Basically advertisers are paying google to keep their customers happy  with interesting toys and technologies, whilst also showing them ads for stuff they probably actually want. And as a geek, I crave the cool cutting edge tech. I want to play with google goggles, and voice to text input, and layar augmented reality browsing etc etc. At the moment it doesn&#8217;t seem like Nokia can compete with that. Which is a shame because the n900 hardware really is awesome.</p>
<p>So the main thing I&#8217;m waiting for this year is news of the nexus two. Unless much changes in the next few months, that will probably be my next device. (Sorry Nokia)</p><br />Filed under: <a href='http://makergeek.co.uk/category/gadgets/'>Gadgets</a>, <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/thoughts/'>Thoughts</a> Tagged: <a href='http://makergeek.co.uk/tag/android/'>android</a>, <a href='http://makergeek.co.uk/tag/apple/'>apple</a>, <a href='http://makergeek.co.uk/tag/business-models/'>business models</a>, <a href='http://makergeek.co.uk/tag/google/'>google</a>, <a href='http://makergeek.co.uk/tag/iphone/'>iphone</a>, <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/n900/'>N900</a>, <a href='http://makergeek.co.uk/tag/nexus-one/'>nexus one</a>, <a href='http://makergeek.co.uk/tag/nexus-two/'>nexus two</a>, <a href='http://makergeek.co.uk/tag/nokia/'>nokia</a>, <a href='http://makergeek.co.uk/tag/rise-of-android/'>rise of android</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/788/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/788/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=788&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=09e666b83e5411df9c705958a36484a684a6&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/09e666b83e5411df9c705958a36484a684a6/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>13 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=09e666b83e5411df9c705958a36484a684a6&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/09e666b83e5411df9c705958a36484a684a6/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Fri, 02 Apr 2010 11:55:39 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-09e666b83e5411df9c705958a36484a684a6</guid>
        </item>
        <item>
            <title>N900 finding its way</title>
            <link>http://makergeek.co.uk/2010/03/21/n900-finding-its-way/</link>
            <description><![CDATA[
<p>The last week has seen some interesting progress for the n900. Firstly it was great to see <a href="http://www.cybercomchannel.com/?p=99">phototranslator</a> finally being availiable in extras-devel. I wrote a couple of weeks ago about having lost patience waiting and <a href="http://danielwould.wordpress.com/2010/03/07/optical-character-recognition-on-the-n900/">played with OCR myself</a>. However phototranslator has put it together in a slick package and combines with google translate api to provide a pretty cool application.<br />
Obviously it is of most use if you are travelling to a foriegn country, translating signs and menus as you go, but it is still interesting to play with and just show off the capabilities of the device (without having to drop to a terminal).</p>
<p>Perhaps the major new item this week is <a href="http://www.sygic.com/index.php/en/features.html">sygic&#8217;s mobile maps</a> being released for sale. There was much rumour that they had been waiting to release via Nokia&#8217;s ovi store. However, they have made it aviliable for sale via their own site.</p>
<p>I purchased it on Friday after some of the initial rush had died down, and sygic had some chance to get their servers working properly. Some of the first off the mark reported painfully slow downloads which dropped and they had to use resuming downloaders to get all the way through. At 1.8gb I didn&#8217;t really want to deal with download problems. Given that the program requires activation via their site, it&#8217;s not clear why they didn&#8217;t just torrent the file and save their servers a lot of problems.<br />
Nonetheless when I came to make my purchase I got about 200kb/sec and it downloaded in about 90mins.</p>
<p>I had read the maemo forums and seen people had trouble with segfaults if the data folders weren&#8217;t in the right place. So I copied to the /home/user/MyDocs folder as instructed. What I didn&#8217;t do was unplug my usb cable, just unmounted the n900 and left it charging only. I got a segfault running the application <span class='wp-smiley wp-emoji wp-emoji-sad' title=':-('>:-(</span><br />
I rebooted the phone, unplugged the cable and then it ran fine to the point of product activation. Where I selected &#8216;automatic&#8217; and entered my product code. Only to find it sat doing nothing for a minute then segfaulted&#8230;.</p>
<p>At this point I was a little concerned about the quality of the app. It&#8217;s response to the unexpected seems to be to segfault, which doesn&#8217;t seem like good code to me.<br />
However, after actually reading some instructions I realised I should go through manual activation, and that product code != Activation code. I went via their site and got my activation code and at last I was up and running.</p>
<p>Once going, I&#8217;ve had no further problems. It&#8217;s a fast application and seems very good. I&#8217;ve only used it to route me home from work, but it did so well. The thing I noticed was how fast it recalculated when I intentionally deviated from the route. No sooner than I made the turn than I looked down to see new route laid out. To be fair I&#8217;m comparing to a now pretty old tomtom, but it&#8217;s recalculation always took a few seconds of processing.</p>
<p>The other thing I noticed was that the map has a housing estate in my town that was built perhaps 5 years ago, but does not have some mini roundabouts on my route home from years before that.<br />
I also note that it doesn&#8217;t seem to care about traffic lights. By which I mean it gives no indication that it would consider them as a factor in routing decisions. I don&#8217;t know if any do, but I hold out hope one day to get routing that knows that 9am on a weekday could mean several extra minutes going through traffic lights.</p>
<p>The maemo forums where quickly full of interesting tips/hacks to enable fullscreen operation &amp; open up more menu options. This allows for portrait operation and more controls. I don&#8217;t know why sygic didn&#8217;t have these enabled by default, perhaps they are not fully tested so have been left in an implicit &#8216;unsupported&#8217; state, but easy to switch on.</p>
<p>Some think it&#8217;s crazy to pay €59 for something nokia might do for free in ovi maps. However given nokias track record so far I&#8217;m not at all convinced they are going to give away anything even close to as good as sygics offering. In terms of price, I paid more for just the France maps addition on my old tomtom, so €59 for the whole of europe seems very good value to me. Now I just need my brodit active holder to ship&#8230;</p>
<p>Rumours have increased that firmware release 1.2 is imminent. Based on some wishful thinking and the fact that the UK has finally gotten the 1.1.1 release that the rest of the world got weeks ago. Along with a number of bugs being marked explicitly as in pr 1.2. Neither of these things need have any baring on the release of the next update, but wishful thinking is hard to put down <span class='wp-smiley wp-emoji wp-emoji-smile' title=':-)'>:-)</span>.</p>
<p>I also became aware this week of <a href="http://gitorious.org/tweego">TweeGo</a>, a new twitter client. This one written with c++/qt and looking very nice. A much slicker ui than my own witter. I am really glad to see more options being actively developed, bringing more choice to n900 users.</p>
<p>Perhaps more significantly than the other things this week&#8230; I wrote the code to add avatar support to witter. Though as yet it&#8217;s not ready to release, it should be reasonably shortly. (Perhaps this should really be something for next week rather than last)<br />
For a long time I pretty much refused to consider avatar support. I figured it would do nothing but take up memory, use up screen space, and slow things down. And it would cost time in coding I was unwilling to spend. However, this week I came accross a thread on maemo forums with some good examples of what I would need. So I had a play and found it didn&#8217;t take too long to get basic support working. Although it must make the memory footprint bigger, it doesn&#8217;t appear to hurt performance. So at somepoint soon witter will look something like this:<br />
<img src="http://danielwould.files.wordpress.com/2010/03/screenshot-20100317-184427.jpg?w=400&#038;h=240" alt="" width="400" height="240" /></p>
<p>To have a few new things arriving for the n900 in a short space of time really gave me the feeling that it is gathering momentum. Getting better and better all the time.<br />
This momentum enourages more development, and hopefully more good information such as the thread I found, which in turn leads to more, better applications.</p>
<p>With a cool new technology demo in phototranslator, a great pay-for gps option from sygic and a slick new twitter client in TweeGo, it&#8217;s hard not to feel optimistic about the future for the N900 after a week like this.</p><br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/thoughts/'>Thoughts</a> Tagged: <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/mobile-maps/'>mobile maps</a>, <a href='http://makergeek.co.uk/tag/n900/'>N900</a>, <a href='http://makergeek.co.uk/tag/ocr/'>ocr</a>, <a href='http://makergeek.co.uk/tag/performance/'>performance</a>, <a href='http://makergeek.co.uk/tag/phototranslator/'>Phototranslator</a>, <a href='http://makergeek.co.uk/tag/python/'>Python</a>, <a href='http://makergeek.co.uk/tag/sygic/'>sygic</a>, <a href='http://makergeek.co.uk/tag/tesseract/'>tesseract</a>, <a href='http://makergeek.co.uk/tag/tweego/'>tweego</a>, <a href='http://makergeek.co.uk/tag/witter/'>witter</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/767/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=767&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">13 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=bb7bc6e834e511dfaed0bb18000a73857385&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/bb7bc6e834e511dfaed0bb18000a73857385/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=bb7bc6e834e511dfaed0bb18000a73857385&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/bb7bc6e834e511dfaed0bb18000a73857385/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sun, 21 Mar 2010 12:01:35 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-bb7bc6e834e511dfaed0bb18000a73857385</guid>
        </item>
        <item>
            <title>Optical character recognition on the N900</title>
            <link>http://makergeek.co.uk/2010/03/07/optical-character-recognition-on-the-n900/</link>
            <description><![CDATA[
<p>This week I decided to spend some time playing with something a little different on my n900. Namely optical character recognition.</p>
<p>This was inspired by a demo by <a href="http://www.cybercomchannel.com/?p=63">Cybercomchannel</a> called phototranslator. It looks cool and I&#8217;m looking forward to them making it availiable for people to try. However I am not a patient man&#8230; So considering they mentioned they simply used <a href="http://code.google.com/p/tesseract-ocr/">Tesseract</a> I figured I could just have a go myself.</p>
<p>I required no particularly special skills to do this, I already had a fremantle scratchbox environment setup, even though I don&#8217;t really need it for Witter. So I downloaded tesseract into scratchbox, did a ./configure, make, make install and presto it built no problem.<br />
Then I realised it only works on tif images, but the n900 camera spits out jpgs. After a short search I found convert from the <a href="http://www.imagemagick.org/script/index.php">Imagemagik</a> tools.</p>
<p>Another simple download and compile and I was now able to convert jpg to tif. I copied the files accross, and quickly found the libraries that also needed copying as they weren&#8217;t initially found.</p>
<p>Tools in hand I knocked up a simple script to tie them together.</p>
<p>ocr.sh:<br />
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/local/lib<br />
echo &#8220;converting image&#8221;<br />
convert $1.jpg /tmp/$1.tif<br />
echo &#8220;recognising text&#8221;<br />
tesseract /tmp/$1.tif /home/user/MyDocs/$1<br />
echo &#8220;text written to /home/user/MyDocs/&#8221;<br />
rm /tmp/$1.tif<br />
leafpad /home/user/MyDocs/$1.txt</p>
<p>first exports the library path to pick up where I put the imagemagik libs. Then converts to a temp file, before running tesseract, and finally launching leafpad with the output.</p>
<p>This isn&#8217;t a slick script, but does mean I can just have a terminal open in the /home/user/MyDocs/DCIM folder and run<br />
ocr.sh 20100307_001<br />
note no .jpg extension makes it easier for the script to handle without and messing around.</p>
<p>I&#8217;ve had a lot of problems with convert crashing out failing to perform the conversion. Not sure why, but normally modifying brightness/contrast in the source is enough to make it work. Sometimes I have to specify the -monochrome option on convert. So far I&#8217;ve not failed to be able to convert an image, it just sometimes takes more tries than I&#8217;d like.</p>
<p>Some examples of it in action.<br />
Test1 &#8211; glossy magazine text<br />
source image: <img src="http://danielwould.files.wordpress.com/2010/03/20100307_001.jpg?w=320&#038;h=240" width="320" height="240" /><br />
Note the flash reflection, I was careful to keep this away from the text I wanted to OCR.<br />
Cropped image:<br />
<img src="http://danielwould.files.wordpress.com/2010/03/test1cropped.jpg?w=600" /><br />
It&#8217;s important to keep the image as cropped as possible to the text to be recognised.</p>
<p>Adjusted for brightness &amp; contrast<br />
<img src="http://danielwould.files.wordpress.com/2010/03/test1brightnessandcontrast.jpg?w=600" /><br />
I found on images like this it&#8217;s helpful to turn up the contrast and turn the brightness down.</p>
<p>Resulting ocr text:<br />
<span style="font-style:italic;">&#8220;A Each   will accept a 5/8&#8243; shanl&lt; tool. But Sovereign is not<br />
juétra lighdle it is a total system. It comes complete with 3/8&quot;<br />
fand l/2&quot; collet adaptors allowing tools with those shank .<br />
diameters to be fitted securely. That means it will take an array<br />
of spindle and bowl gouges; To add to the versatility we have<br />
also adapted a couple of highly popular hollowing tools- the<br />
hollowmaster and multi tip hollowing t0ol.»Ihese are now _ _<br />
available in three lengths and without handle to make the i<br />
Sovereign System one very practical and<br />
    it&quot;</span></p>
<p>As you can see it&#8217;s not perfect, but really pretty good. The process is not that lengthy either. Perhaps 20 seconds for convert and ocr to run.</p>
<p>Then I tried some plain black text on white background</p>
<p><img src="http://danielwould.files.wordpress.com/2010/03/20100307_002.jpg?w=600" /></p>
<p>Which i also adjusted for brightness/contrast<br />
<img src="http://danielwould.files.wordpress.com/2010/03/test2brightnessandcontrast.jpg?w=600" /></p>
<p>Which got these results:<br />
<span style="font-style:italic;">&#8220;The Championships Wimbledon 20l0<br />
The Wingheld Restaurant is the only bookable, waiter-served restaurant offering a 3·course lunch with wine and mineral water<br />
for £6O per person, including service. To make a reservation for a maximum of six guests per table, piease visit our website<br />
<a href="http://www.fmccatcrlng.c¤.uk" rel="nofollow">http://www.fmccatcrlng.c¤.uk</a> and click on &#8220;Food and Drink atWimbledon&#8221;. The Reservations page will own from Monday l5th<br />
February 20lO.<br />
Your reservation will be confirmed once you have completed the on·line booking and payment form and operates on a striittiy<br />
first come first served basis.After the transaction is complete, you will receive a confirmation email which you shouid keep safe<br />
and bring it with you on the day of your reservation.<br />
if you do not have access to the internet, we will still accept reservations by fax on O20 8944 2253 or by letter toThe Reservations<br />
Manages; Facilities Management Catering Ltd., Church Road,Wimbledon, London SW l 9 SAE. Please remember to include aii your<br />
contact details, the date you would like a reservation and for how many people. Cheques should be made payable to Compass<br />
Services UK Ltd. Confirmation of non-internet reservations will be sent out during the third week of May.<br />
Reservations may not be made by telephone but if you have a query on a confirmed booking, you may telephone 020 S24? liu;}<br />
from Monday 26th April. The dress code is smart casual (no jeans) and we are unable to accept msemuens for<br />
s The restaurant opens at l l.l Sam and we do not allocate individual seating arrangements prior m your awmio yi _ y   T    r .ve  i<br />
~ E _y°. s ; .i i C;   _ liiv y T s Official caterers to The Championships, Wimbledon   C   s yl _ if yyes v   it Qi _‘ .. e yipyr y   lsly g<br />
&#8220;</span></p>
<p>This is pretty much best case conditions and I think it does a really good job.</p>
<p>I did also try a hand written test<br />
<img src="http://danielwould.files.wordpress.com/2010/03/test3contrast.jpg?w=600" /><br />
But it only manged to detect &#8220;over #06 lazy&#8221;<br />
Which I guess considering my handwriting is pretty good too <span class='wp-smiley wp-emoji wp-emoji-smile' title=':-)'>:-)</span></p>
<p>Sadly I lack the time to turn all this into a consumable download for others. Which brings me to a realisation that some people missunderstand what is meant when the n900 is referred to as a great developer phone. I&#8217;ve seen people complaining that there aren&#8217;t great apps available so it&#8217;s not great at all. But the point is that this is a fantastic phone for *me* and others like me. The fact that I could just grab some open source software and put this together is awesome. But I don&#8217;t have time to wrap it up in a nice package for other people, and I have no great motivation to do so. Anyone prepared to invest a little time and effort can do amazing things with this device, but if you are just sitting and waiting for someone else to put in that effort and give you something on a plate, you just might be waiting for some time.</p><br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/project/'>project</a>, <a href='http://makergeek.co.uk/category/thoughts/'>Thoughts</a> Tagged: <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/n900/'>N900</a>, <a href='http://makergeek.co.uk/tag/ocr/'>ocr</a>, <a href='http://makergeek.co.uk/tag/optical-character-recognition/'>optical character recognition</a>, <a href='http://makergeek.co.uk/tag/tesseract/'>tesseract</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/760/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=760&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">21 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=5af88d7a29e511df85260ff3f70500dc00dc&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/5af88d7a29e511df85260ff3f70500dc00dc/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=5af88d7a29e511df85260ff3f70500dc00dc&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/5af88d7a29e511df85260ff3f70500dc00dc/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sun, 07 Mar 2010 12:12:42 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-5af88d7a29e511df85260ff3f70500dc00dc</guid>
        </item>
        <item>
            <title>A long overdue refactor</title>
            <link>http://makergeek.co.uk/2010/02/27/a-long-overdue-refactor/</link>
            <description><![CDATA[
<p>For the last couple of weeks, my time on <a href="http://danielwould.wordpress.com/Witter">Witter</a> has been spent refactoring the code to be more managable. And hopefully allow easier addition of things like multiple account support.</p>
<p>To be honest it was very ugly code, pretty much a single &#8216;monolithic&#8217; code base, hacked together for speed of initial development. I knew that I would just be building up a big refactoring job, but I chose to do it that way anyway.</p>
<p>Why? Because I have very limited time in which to develop Witter, and it&#8217;s supposed to be fun. If I had tried to learn all the right ways to do things in python before I started, I probably would have gotten bored before it did anything. This way, I&#8217;ve had fun building up a bunch of usful function, and learned a lot of python as I went. So now I can refactor a little into some sensible architecture, and know when I&#8217;ve got it right, because all of the functions will work again.</p>
<p>I&#8217;m mostly done at this point. I&#8217;ve broadly split things into 3. The account object, which handles fetching and storing dfferent tweet timelines (dms,mentions etc), a gui object where I&#8217;m trying to put all the gtk-ness. And a controller object which ties the two together. I&#8217;m sure as I go on I&#8217;ll make further structural changes, hopefully each will be easier than the last. I still wouldn&#8217;t go so far as to say it&#8217;s good code, but it&#8217;s deffinately better than before.</p>
<p>Amongst my reworking I spotted a really stupid performance bug. At some point I decided that switching views, and checking what the current view is could be done by comparing the current treeview model, with the various ones it could be.<br />
So:<br />
If (self.treeview.get_model() == self.timeline):<br />
Elif (self.treeview.get_model() == self.mentions):<br />
Etc etc<br />
what this meant was that I was comparing list store objects for eqaulity, where those objects are growing over time as more tweets arrive. And worse, for any view further down, it has to do 5/6 failed object compares before it gets there. This I suspect is responsible for witter slowing down over time for switching views.<br />
I offer no particular excuse, I wasn&#8217;t thinking clearly, it probably seemed the easiest thing to do at the time.</p>
<p>In anycase, I have now declared some constant integer values, and set and compare these. Funily enough, computers are much faster at comparing small ints than they are at comparing large object structures.</p>
<p>So now it&#8217;s<br />
curView = self.ui.getCurrentView()<br />
If (curView == self.ui.TIMELINE_VIEW):<br />
Elif (curView == self.ui.MENTIONS_VIEW):<br />
Etc&#8230;</p>
<p>Now that things are mostly working again, I&#8217;m working on storing account objects nicely. I&#8217;d hoped to just pickle them to disk,  but it seems there are limitations on what can be pickled. So I&#8217;ll have to look for some other options.</p>
<p>At this point I&#8217;m actually quiet keen to get witter to a point where I can put it on a back burner, and start playing with some of the other cool things people have been doing, such as face tracking with the front camera and text recognition. It is starting to feel like there are going to be some really cool capabilities added to the n900 over the next 6 months. Who knows, I may even put avatar support in witter just so I can focus on new things without on going requests for it.</p><br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/project/'>project</a>, <a href='http://makergeek.co.uk/category/thoughts/'>Thoughts</a> Tagged: <a href='http://makergeek.co.uk/tag/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/tag/performance/'>performance</a>, <a href='http://makergeek.co.uk/tag/python/'>Python</a>, <a href='http://makergeek.co.uk/tag/refactor/'>refactor</a>, <a href='http://makergeek.co.uk/tag/rewrite/'>rewrite</a>, <a href='http://makergeek.co.uk/tag/witter/'>witter</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/753/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=makergeek.co.uk&#038;blog=3709593&#038;post=753&#038;subd=danielwould&#038;ref=&#038;feed=1" width="1" height="1" /><span class="net_nemein_favourites">11 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=6174a960239411dfb5ddf7c71e1dda20da20&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/6174a960239411dfb5ddf7c71e1dda20da20/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=6174a960239411dfb5ddf7c71e1dda20da20&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/6174a960239411dfb5ddf7c71e1dda20da20/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 27 Feb 2010 11:25:40 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-6174a960239411dfb5ddf7c71e1dda20da20</guid>
        </item>
        <item>
            <title>N900 charging from ‘dumb’ charger</title>
            <link>http://makergeek.co.uk/2010/01/31/n900-charging-from-dumb-charger/</link>
            <description><![CDATA[
<p>Updated 27/5/2011 &#8211; updated to reflect comment that really using 200ohm resistor is at the upper limits of spec and more likely to cause a problem than no resistor at all.</p>
<p>This weekend I took Kat up to London for a couple of days. Knowing that my n900 is a bit of a battery vampire I took with me a generic USB charger an my nokia usb cable.</p>
<p>At the end of the first day we returned to the hotel and I plugged in my n900 as it was on it&#8217;s very last gasps of power. Only to discover that it did not register any charge. I previously noted an issue with this charger when I&#8217;d completely run out of charge and found that whilst it did register charge nothing became responsive until I plugged it into a computer.</p>
<p>Very odd.</p>
<p>The next morning I went out early to grab a new usb charger from the maplin that was down the road from our hotel. I bought one with 2 USB sockets on the basis that it would be helpful to charge multiple devices. But when I tried it out I found that I still got no charge. At this point it would have been good to be able to do some research on line. However&#8230; no charge!</p>
<p>So during the day, after going to the natural history museum, we took a trip to the Nokia store on Regent Street, and I bought a new official Nokia charger. I did ask if they knew any reason why my generic usb chargers weren&#8217;t working, but the sales guy knew nothing.</p>
<p>After some research I found that the issue of charging is down to the spec for charging from micro usb. It turns out that the N900 is adhering to the spec, that says it can determine a &#8216;dumb&#8217; charger if the the d+ d- data lines are connected via a 200 Ohm resistor.</p>
<p>I found this on the talk.maemo.org forum written by <a href="http://talk.maemo.org/showpost.php?p=496596&amp;postcount=81">shadowjk</a><br />
<em>You can find the Battery Charging spec at <a href="http://www.usb.org/developers/devclass_docs" target="_blank">usb.org</a>, in a <a href="http://www.usb.org/developers/devclass_docs/batt_charging_1_1.zip" target="_blank">zip</a>. batt_charging_1_1_FINAL.pdf</em></p>
<p><em>Page 7 shows the connection, “A Dedicated Charging Port is required to short the D+ and D- lines with a resistance of RDCHG_DAT”, page 29 specifies max 200 ohms across D+ and D-. Although the wording on page 7 suggests it should be exactly 200 ohms&#8230; Also on Page 29, a minimum of 2 MEGA ohms of resistance between D+ and ground or vbus. That is, not connected together at all.</em></p>
<p>Several people on the forums found that simply soldering d+ and d- together was sufficient, but I decided I&#8217;d go with the resistor option, since I had a 200 ohm resistor laying around anyway. &#8211; However as noted below this is actually the max allowed resistance and could potentially cause problems. People that know more about electronics than I suggest that simply shorting the wires is the intended specification and the best thing to do. Since it&#8217;s also the easiest thing to do, I wouldn&#8217;t bother with any resistor if I were doing this again.</p>
<p>I had a cheap 4 port usb hub that I wasn&#8217;t using, and I figured I could rip a socket and the plug out of that. So I broke out the <a href="http://www.amazon.co.uk/gp/product/B000LZ1VXE/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=danwousweb-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=B000LZ1VXE">soldering iron and desoldering pump</a> , desoldered one of the sockets, and the plug. Then used a bit of <a href="http://www.amazon.co.uk/gp/product/B0040Z30R6/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=danwousweb-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=B0040Z30R6">strip board</a> and soldered the pieces back on, but with a 200 ohm resistor joining the two middle strips. And voila! easy as that I could plug this into any generic usb charger, and plug my normal cable and get charge.</p>
<p><a href="http://danielwould.files.wordpress.com/2010/01/20100131_008.jpg"><img class="alignnone size-medium wp-image-728" title="usb cable with d+ d- joined with resistor" src="http://danielwould.files.wordpress.com/2010/01/20100131_008.jpg?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>Here it&#8217;s on a strip board which I later cut down to size and fit the assembly back inside the original case</p>
<p><a href="http://danielwould.files.wordpress.com/2010/01/20100131_009.jpg"><img class="alignnone size-medium wp-image-729" title="20100131_009" src="http://danielwould.files.wordpress.com/2010/01/20100131_009.jpg?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>I could probably have made the whole thing smaller, but it&#8217;s not too bad. And now I can use any generic usb charger.</p>
<p>This weekend really made me appreciate how much I want battery tech to improve to the point it will last weeks of heavy usage no just hours.</p>
<br />Filed under: <a href='http://makergeek.co.uk/category/maemo/'>maemo</a>, <a href='http://makergeek.co.uk/category/project/'>project</a> Tagged: <a href='http://makergeek.co.uk/tag/200-ohm/'>200 ohm</a>, <a href='http://makergeek.co.uk/tag/dumb-charger/'>dumb charger</a>, <a href='http://makergeek.co.uk/tag/n900/'>N900</a>, <a href='http://makergeek.co.uk/tag/usb/'>usb</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/danielwould.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/danielwould.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/danielwould.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/danielwould.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/danielwould.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/danielwould.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/danielwould.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/danielwould.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/danielwould.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/danielwould.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/danielwould.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/danielwould.wordpress.com/727/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makergeek.co.uk&amp;blog=3709593&amp;post=727&amp;subd=danielwould&amp;ref=&amp;feed=1" width="1" height="1" /><span class="net_nemein_favourites">12 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=109423580eaa11dfb2b859fa5a935ba05ba0&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/109423580eaa11dfb2b859fa5a935ba05ba0/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>2 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=109423580eaa11dfb2b859fa5a935ba05ba0&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/109423580eaa11dfb2b859fa5a935ba05ba0/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sun, 31 Jan 2010 20:44:54 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-109423580eaa11dfb2b859fa5a935ba05ba0</guid>
        </item>
        <item>
            <title>Displaying a busy indicator on maemo python app.</title>
            <link>http://danielwould.wordpress.com/2010/01/16/displaying-a-busy-indicator-on-maemo-python-app/</link>
            <description><![CDATA[
<p>This is the post I wish existed when I was looking for how to do this simple thing. I spent hours reading around trying to figure out how to show my app is busy, but to no avail.</p>
<p>Lets first look at the &#8216;why?&#8217;.<br />
So you&#8217;ve written yourself a python app for maemo, you&#8217;ve figured out how do do some interesting things and your little project is becoming really quiet useful. Having got it to go do some processing, you ralised that it was locking up the whole user interface whilst it ran, and so you have figured out threads. Everything is going great. The UI no longer freezes when the user presses the &#8216;go&#8217; button. But there is a problem.</p>
<p>The time between the user hitting go, and your application having done it&#8217;s thing is filled with the user staring at the UI wondering&#8230;&#8217;is it working? Did I hit the button enough? This is rubb&#8230;oh theres the response I guess that&#8217;s ok then&#8217;</p>
<p>What you want is to show the user that you&#8217;ve registered their click and are busy working on it for them. Enter, the busy indicator&#8230;<br />
Everyone is familiar with this concept, little spinning wheels or hour glasses etc. So how do you do this in maemo?</p>
<p>My big mistake was thinking of it as a busy indicator, when I should of thought about it as a progress bar. Personally I think of these as two quiet different things.<br />
Lucky for me <a href="http://talk.maemo.org/member.php?u=27193">mwerle</a> on the talk.maemo.org forums was a few steps ahead of me, and he found the answer in the <a href="http://wiki.maemo.org/PyMaemo/UITutorial/Additions_to_GTK%2B#Progress_indicators">pymaemo documentation</a> under the section on progress bars. He then posted a comment on my <a href="http://talk.maemo.org/showthread.php?t=35596&amp;highlight=witter&amp;page=13">witter thread</a> letting me know. It is hard to explain how happy I am when someone helps me with a problem by giving me specific code examples. It makes my life so much easier, so I&#8217;m always really grateful.</p>
<p>It turns out to be as simple as:<br />
<code><br />
       hildon.hildon_gtk_window_set_progress_indicator(dialog, 1)<br />
</code> </p>
<p>Where 1 turns it on, and 0 turns it off. This puts a little spinning indicator into the title bar or your window/dialog whatever you pass in the first argument.</p>
<p>So simple when you know how.</p>
<p>Of course there is a little extra complication if you can have multiple threads, since you need to co-ordinate them setting/unsetting this indicator.</p>
<p>For witter I wrote a simple method every thread calls on entry and exit. On entry they call with a value of +1 on exit they call with a value of -1</p>
<p><code><br />
    def showBusy(self, increment, *args):<br />
        #increment might be +1 or -1 to take the counter up or down<br />
        self.busyCounter = self.busyCounter + increment<br />
        print "running tasks: " + str(self.busyCounter)<br />
        if (self.busyCounter &gt; 0):<br />
            #at least one thing running<br />
            hildon.hildon_gtk_window_set_progress_indicator(self.window, 1)<br />
        else:<br />
            #no more tasks busy<br />
            hildon.hildon_gtk_window_set_progress_indicator(self.window, 0)<br />
            #in case we missed it somewhere, no longer getting Tweets<br />
            self.gettingTweets = False</p>
<p>        return<br />
</code>  </p>
<p>Simply it counts how many active threads there are. And whilst that&#8217;s not 0 it sets the busy indicator on.</p>
<p>Hopefully this post will help the next developer save some time.</p>
<br />Posted in maemo, project, top tip Tagged: Busy indicator, development, fremantle, hildon, N900, progress indicator, Python, witter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/danielwould.wordpress.com/717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/danielwould.wordpress.com/717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/danielwould.wordpress.com/717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/danielwould.wordpress.com/717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/danielwould.wordpress.com/717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/danielwould.wordpress.com/717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/danielwould.wordpress.com/717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/danielwould.wordpress.com/717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/danielwould.wordpress.com/717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/danielwould.wordpress.com/717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/danielwould.wordpress.com/717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/danielwould.wordpress.com/717/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=danielwould.wordpress.com&amp;blog=3709593&amp;post=717&amp;subd=danielwould&amp;ref=&amp;feed=1" width="1" height="1" /><span class="net_nemein_favourites">15 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=22e30dca02a311dfb566336eb2a4cef2cef2&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/22e30dca02a311dfb566336eb2a4cef2cef2/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=22e30dca02a311dfb566336eb2a4cef2cef2&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/22e30dca02a311dfb566336eb2a4cef2cef2/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 16 Jan 2010 13:20:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-22e30dca02a311dfb566336eb2a4cef2cef2</guid>
        </item>
        <item>
            <title>Setting up maemo 5 python development environment</title>
            <link>http://danielwould.wordpress.com/2010/01/10/setting-up-maemo-5-python-development-environment/</link>
            <description><![CDATA[
<p>Last week I finally got around to downgrading my laptop from karmic to jaunty. I did this for a couple of reasons. For my laptop the control of external displays regressed from working flawlessly, to crashing everytime it tried to detect an external display that it didnt boot with.<br />
Secondly,, eclipse has some major problems on karmic due to some changes. The fault is with eclipse, but it will be some time before any fixes work through to the eclipse based products I need to work with, so I downgraded.</p>
<p>This meant that I wanted to set up my development environment again for witter, and decided to try and make a better job of it.<br />
So first thing I did was install <a href="http://esbox.garage.maemo.org/">esbox</a>.<br />
The python plugins are pretty good, and just simple stuff like the outline view of the code, makes navigating around much easier. And some basic syntax highlighting goes a long way to improve productivity.</p>
<p>However the main reason I stopped using esbox before was i failed to get it working with the subversion plugins. I ended up following the instructions <a href="http://www.niharsworld.com/2009/10/07/svn-subversive-missing-eclipse-342-ganymede-installation-instructions/">here</a> which got me going nicely.</p>
<p>So why is subversion support so important? If you are going to get even slightly into developing any app, you really want it in some kind of version control system. Ideally one hosted somewhere, so that should the worst happen to your pc, you dont lose it. But verison control is more than just backup, its freedom to make wide reaching changes without any worry that you can&#8217;t get back to a working system. Wither version control it is trivial to go back to any previous version. I personally like to be able to see how my application evolves over time, as it&#8217;s useful for writing blog posts about it.</p>
<p>So svn is just one possible version control system, however it is the one used by garage.maemo.org. Which is the easiest place to find hosting for your maemo project, since you can just sign up and get it free and easy.<br />
I personally would like to see more integration between garage and the talblet repository / build system. It would be cool is a correctly formed project in svn in garage could automagically be built correctly at the click of a button. But it isn&#8217;t. At least not yet.</p>
<p>So with esbox and svn support i was ready to checkout witter back into my workspace and get on with development. However I personally quite like having the <a href="http://maemo.org/development/sdks/maemo_5_beta_2_sdk_installation/">fremantle development environment</a>. With esbox you can just run python right on the device if you configure it as a remote environment. And there are distinct advantages to this approach, not least the fact you don&#8217;t have to setup scratchbox etc.<br />
However I find it faster, once setup, to copy files into scratchbox and run locally, rather than ssh things accross to my n900 which i then have to switch to, then back to laptop etc.</p>
<p>The important things for python in the scratchbox development environment are,&#8230;don&#8217;t bother with the armel target. That is only really needed if you are compiling c for the device. The x86 target is better because you can actually run the emulated n900.<br />
Once youve setup stcratchbox, done the updates, and installed the nokia-binaries pacakge. You will want to add the extras-devel repository to your /etc/apt/sources.list. This allows you to install all the required python libraries.<br />
I&#8217;d list them here, but I find it useful to stumble over each library my app needs as I add the imports, since I can keep a list which will ultimatly make it into a depends declaration when you build your python project into an installable app.</p>
<p>The other thing you want to do in scratchbox is modify the /etc/resolv.conf file to match that of your host system. Without it you won&#8217;t be able to resolve any internet addresses. Given you are developing for a mobile internet device, it&#8217;s likely your app will need to access the internet.</p>
<p>I personally develop in esbox natively in ubuntu. Then copy my files into scratchbox. And I have Xephyr running, with maemo 5 up inside it. And a terminal logged into scratchbox where I can run/rerun my app.</p>
<p>Then when I want to copy onto my n900 I just scp the files to the device.</p>
<p>With this setup, anyone wanting to look at the witter source can just open a new project in esbox as an svn project and enter the svn details for <a href="https://garage.maemo.org/scm/?group_id=1153">witter</a> (or whatever project from garage you are interested in) and you can start playing with the code much as the developer does.</p>
<p>It&#8217;s not as good as eclipse for java, but it makes devloping in python a little easier, and integration with svn makes working with a garage project nicer to do. Maybe in time there will be more great python help for would-be developers.</p>
<br />Posted in maemo, project, SoftwareEngineering Tagged: development, esbox, fremantle, hildon, jaunty, N900, Python, witter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/danielwould.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/danielwould.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/danielwould.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/danielwould.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/danielwould.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/danielwould.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/danielwould.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/danielwould.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/danielwould.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/danielwould.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/danielwould.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/danielwould.wordpress.com/710/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=danielwould.wordpress.com&blog=3709593&post=710&subd=danielwould&ref=&feed=1" /><span class="net_nemein_favourites">12 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=6a68929efdf511dea2a43d01ce084ae84ae8&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/6a68929efdf511dea2a43d01ce084ae84ae8/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=6a68929efdf511dea2a43d01ce084ae84ae8&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/6a68929efdf511dea2a43d01ce084ae84ae8/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sun, 10 Jan 2010 12:54:42 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-6a68929efdf511dea2a43d01ce084ae84ae8</guid>
        </item>
        <item>
            <title>Maemo : Custom cell renderer for gtk treeview (python)</title>
            <link>http://danielwould.wordpress.com/2010/01/02/maemo-custom-cell-renderer-for-gtk-treeview-python/</link>
            <description><![CDATA[
<p>I wrote a couple of weeks ago a little <a href="http://danielwould.wordpress.com/2009/12/16/custom-cell-renderer/">teaser</a> about writing a custom cell renderer.</p>
<p>When I first started witter, I found that a treeview was the obvious way to display tweets. And the available cell renderer was CellRendererText.<br />
which took care of the basics. However it didn&#8217;t look terribly &#8216;pretty&#8217;</p>
<p>This post shows the code I wrote, and how it evolved as I figured out more things. Unfortunately when putting code into wordpress I can either have it render as normal text and thus unreadable as structured code, or have it rendered like code but victim to cropping off the ends of long lines due to my fixed with blog theme. For full code listing go look at:<a href="https://garage.maemo.org/plugins/scmsvn/viewcvs.php/fremantle/src/opt/witter/witter/witter_cell_renderer.py?root=witter&amp;view=log#rev10">Version history for witter_cell_renderer</a></p>
<p>When I started out, I soon discovered that if I wanted anything nicer I would have to write my own cell renderer, taking responsibility for drawing rectangles behind the text, and rendering the text.</p>
<p>I quickly figured out how to draw the cells, with nice rounded corners:</p>
<pre><code>
def render_rect(self, cr, x, y, w, h):
	'''
	create a rectangle with rounded corners
	'''

	x0 = x
	y0 = y
	rect_width = w
	rect_height = h

	radius = 10

	#draw the first half with rounded corners
	x1 = x0 + rect_width
	y1 = y0 + rect_height
	cr.move_to(x0, y0 + radius)
	cr.curve_to(x0, y0+radius, x0, y0, x0 + radius, y0)
	cr.line_to(x1 -radius, y0)
	cr.curve_to(x1-radius, y0, x1, y0, x1, y0 + radius)
	cr.line_to(x1, y1-radius)
	cr.curve_to(x1, y1-radius, x1, y1, x1 -radius, y1)

	cr.line_to(x0 +radius, y1)
	cr.curve_to(x0+radius, y1, x0, y1, x0, y1-radius -1)
	cr.close_path()
</pre>
<p></code></p>
<p>This works based on being given the size of the 'cell' and drawing straight lines to point just in from the corners, then using curve_to to draw curves in the corner spaces.</p>
<p>then I found some examples that showed how you create a 'patern' by setting colour stops, then calling cairo_context.fill to colour in the rectangle.<br />
By doing this you can get colour gradients which make the cell look a little nicer than just a flat background colour.<br />
My first draft looked like this:</p>
<pre><code>
pat = cairo.LinearGradient(x, y, x, y + h)
	color = gtk.gdk.color_parse("#6495ED")
	pat.add_color_stop_rgba(
							0.0,
							self.get_cairo_color(color.red),
							self.get_cairo_color(color.green),
							self.get_cairo_color(color.blue),
							1
							)
	color = gtk.gdk.color_parse("#5F9EA0")
	pat.add_color_stop_rgba(
							0.5,
							self.get_cairo_color(color.red),
							self.get_cairo_color(color.green),
							self.get_cairo_color(color.blue),
							1
							)
	color = gtk.gdk.color_parse("#6495ED")
	pat.add_color_stop_rgb(
							1.0,
							self.get_cairo_color(color.red),
							self.get_cairo_color(color.green),
							self.get_cairo_color(color.blue)
							)

	cairo_context.set_source(pat)
	cairo_context.fill()
</pre>
<p></code><br />
Note that the colour values I just picked from thin air, and they turned out around red. Later I actually took a screen shot of an application window on my N900, and used gimp to grab the colour gradient used in the app switcher button. By re-using those colours for my gradient it made the app instantly feel more at home on the n900.</p>
<p>All was going well enough, but then I made a mistake, I hit upon<br />
cairo_context.show_text(str) and started to build code around using it.<br />
I wound up with something fairly complicated. You see I wanted to check words for some key things, and set different colours for them. I also wanted to wrap text on word boundaries. And obviously not overflow the screen width with text.<br />
Using cairo and it's text handling methods you can give it a string and ask it, given the current font settings, what will be the extents of the rendering for that text. From this I build a very compliated routine which figured out how many lines I would need to split into, in order to keep it all in the right width. And based on this determine the height of the cell required. I used this in my on_get_size method to return the cell size, which I would later be passed to render the rectangle and text in.<br />
This way of doing things left me with this complicated mess:</p>
<pre><code>
#we want to calculate the actual height to render the backing so we need the space required
	#to render the string using the specified font and font size
	cairo_context.set_source_rgba(1, 1, 1, 1)
	cairo_context.select_font_face("Georgia",
        cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_BOLD)
	cairo_context.set_font_size(self.get_property('font_size'))

	x_bearing, y_bearing, width, height = cairo_context.text_extents(self.get_property('text'))[:4]

	#get the text
	tweet = self.get_property('text')

	seg_len = self.get_seg_len_for_font_size(cairo_context,self.get_property('font_size'),(w-20))
	words = tweet.split(" ")
	line = ""
	linecount = 0
	#set the starting position for text display
	cairo_context.move_to(x+10, ((y+height)))
	for word in words:

		if ((len(line) + len(word) + 1) &gt; seg_len):
			#set the position for the line of text, we start in the top quarter then drop in text heigh increments
			cairo_context.move_to(x+10, ((y+height) + ((linecount+1)*height) +2))

			#set the line string to the word we didn't add
			line = word
			linecount = linecount +1
		else:
			line = line + " "+word
		if ( word.startswith("@")):
			cairo_context.set_source_rgba(0, 0, 0, 1)
		elif ( word.startswith("http:")):
			cairo_context.set_source_rgba(0, 1, 1, 1)
		else:
			cairo_context.set_source_rgba(1, 1, 1, 1)
		word = word.replace("&amp;","&amp;")
		word = word.replace("&lt;","")
		cairo_context.show_text(word + " ")

	if (self.get_property('replyto') != ""):
		#process any retweet text

		cairo_context.set_source_rgba(1, 1, 1, 1)

			cairo_context.set_font_size(self.get_property('font_size') -5)
		x_bearing, y_bearing, width, height = cairo_context.text_extents(self.get_property('replyto'))[:4]
		cairo_context.move_to(x+10, ((y+height) + ((linecount+1)*height) +self.get_property('font_size') -5))
		seg_len = self.get_seg_len_for_font_size(cairo_context,self.get_property('font_size')-5,(w-20))
		retweet = self.get_property('replyto')
		retweetwords = retweet.split(" ")
		for word in retweetwords:

			if ((len(line) + len(word) + 1) &gt; seg_len):
				#set the position for the line of text, we start in the top quarter then drop in text heigh increments
				cairo_context.move_to(x+10, ((y+height) + ((linecount+2)*height) +self.get_property('font_size') -5))

				#set the line string to the word we didn't add
				line = word
				linecount = linecount +1
			else:
				line = line + " "+word
			if ( word.startswith("@")):
				cairo_context.set_source_rgba(0, 0, 0, 1)
			elif ( word.startswith("http:")):
				cairo_context.set_source_rgba(0, 1, 1, 1)
			else:
				cairo_context.set_source_rgba(1, 1, 1, 1)
			word = word.replace("&amp;","&amp;")
			word = word.replace("&lt;","")
			cairo_context.show_text(word + " ")

	cairo_context.set_source_rgba(1, 1, 1, 1)
	cairo_context.select_font_face("Georgia",
        cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_BOLD)
	cairo_context.set_font_size(self.get_property('font_size') -5)
	ts_x_bearing, ts_y_bearing, ts_width, ts_height = cairo_context.text_extents(self.get_property('timestamp'))[:4]
	#position in the bottom right, in set by the width of the timestamp, and a little padding
	cairo_context.move_to(x+(w-(ts_width+10)), y+(h-5))
	cairo_context.show_text(self.get_property('timestamp'))

</code></pre>
<p>Yikes! basically I figured out how long a text 'segment' would be to fit on a line. Then split the whole tweet into words, and for each word figured out if adding it to the current line would take it over the segment length or not. If it would it became the first word on the new line. And I also had to handle setting the start of line to the next starting position.<br />
I then did the same again for reply text if there was any. And finally set the timestamp in the bottom right corner of the cell.</p>
<p>For all this effort it looked ok:<br />
<img alt="" src="http://farm3.static.flickr.com/2647/4199658021_246980b6f9_o.png" title="first pass cell renderer" class="alignnone" width="480" height="240" /></p>
<p>I had by this point set the colours right, and the tweets where wrapping properly, rather than splitting lines wherever (the default cellRendererText was just spliting anywhere by default)</p>
<p>However... The lines were getting split in slightly weird ways, sometimes, as in the picture, I got two lines that were quite short, instead of one full line and just whatever needed to be on the second.</p>
<p>The other major problem was that this no longer rendered any non romanised languages. Eg Chinese, Japanese, arabic etc etc. These rendered just fine in the normal text cell renderer. But not now, this was most annoying.</p>
<p>So I did some digging and found that I should not have been using the cairo text rendering methods at all. That there is something called 'pango' which provides a much better interface for rendering text.<br />
And importantly, it supports non-romanised fonts properly. The problem is something about most fonts don't have glyphs for all languages, and so cairo renders only in the font you select, but pango will go find a font that does have the right glyphs if they aren't present in your selected font.</p>
<p>to use pango you create a pangocairo context, which can be used just like a cairo context:</p>
<pre><code>
cairo_context = pangocairo.CairoContext(window.cairo_create())
</code></pre>
<p>Suddenly all that text rendering logic gets MUCH easier, because pango has the ability for you to tell it the wrap width you'd like it to use, and whether it should wrap on word boundaries.<br />
It can then be called to get the extents of rendering that text, so my method to calculate the cell size required got much simpler and more accurate.</p>
<p>additionally pango supports a markup language much like HTML, so instead of rendering one word at a time and changing colours, I could simply tag up the text with some markup around they keywords, and let pang render the colours.</p>
<p>the resulting text rendering logic looks like this:</p>
<pre><code>
layout = cairo_context.create_layout()
	font = pango.FontDescription("Sans")
	font.set_size(pango.SCALE*(self.get_property('font_size')))
	font.set_style(pango.STYLE_NORMAL)
	font.set_weight(pango.WEIGHT_BOLD)
	layout.set_font_description(font)
	layout.set_width(pango.SCALE *w)
	layout.set_wrap(pango.WRAP_WORD)

	#get the text as a unicode string
	tweet = unicode(self.get_property('text'))
	line = ""
	words = tweet.split(" ")
	for word in words:
		if (word.startswith("@")):
			word = "<span>" + word +"</span>"
		if (word.startswith("http:")):
			word = "<span>" + word +"</span>"
		line = line + " " + word

	#set the starting position for text display
	cairo_context.move_to(x+10, ((y+10)))

	layout.set_markup(line)
		#layouts start again from begining not where you left off with last word
	inkRect, logicalRect = layout.get_pixel_extents()
	tweet_x, tweet_y, tweet_w, tweet_h = logicalRect

	cairo_context.show_layout(layout)
	if (self.get_property('replyto') != ""):
		#process any retweet text
		layout = cairo_context.create_layout()
		cairo_context.set_source_rgba(1, 1, 1, 1)
		font = pango.FontDescription("Sans")
		font.set_size(pango.SCALE*(self.get_property('font_size')-6))
		font.set_style(pango.STYLE_NORMAL)
		font.set_weight(pango.WEIGHT_BOLD)
		layout.set_font_description(font)
		layout.set_wrap(pango.WRAP_WORD)
		layout.set_width(pango.SCALE *w)
		#set position under the main tweet text
		cairo_context.move_to(x+10, ((y+tweet_h+10)))
		layout.set_text(self.get_property('replyto') )
		#layouts start again from begining not where you left off with last word
		cairo_context.show_layout(layout)

	cairo_context.set_source_rgba(1, 1, 1, 1)
	cairo_context.select_font_face("Georgia",
        cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_BOLD)
	cairo_context.set_font_size(self.get_property('font_size') -5)
		ts_x_bearing, ts_y_bearing, ts_width, ts_height = cairo_context.text_extents(self.get_property('timestamp'))[:4]
	#position in the bottom right, in set by the width of the timestamp, and a little padding
	cairo_context.move_to(x+(w-(ts_width+10)), y+(h-5))
	cairo_context.show_text(self.get_property('timestamp'))

</code></pre>
<p>At this point I'm still using regular cairo to render the timestamp, mostly because I've not got around to adjusting it.<br />
But the main work is now much easier, I still split the line into words to be able to tag appropriately around urls and twitter usernames.<br />
but there is just one position set and render per tweet, then another if there is a reply. I'm not having to maintain positional state to render each line myself.</p>
<p>One thing that caught me out briefly is that pango operated in 'pango scale' So if you want to give it, for instance the width to wrap at, you have to multiply your width number by pango.SCALE to get what you expect.</p>
<p>For a while I thought it still wasn't working with non romanised fonts, because when I ran it in my scratchbox development environment, it just rendered boxes with the hex numbers in, rather than the real glyphs. This turned out to be just because the development environment isn't set up (quite right/the same).  When run on a real N900 it renders just fine:</p>
<p>http://farm3.static.flickr.com/2770/4227987217_201ee955be_o.png</p>
<p><img alt="" src="http://farm3.static.flickr.com/2770/4227987217_201ee955be_o.png" title="pango rendering non romanised fonts" class="alignnone" width="480" height="240" /></p>
<p>So there you have it, if you want to write your own cell renderer for a treeview, use pango to render your text.</p>
<br />Posted in maemo, SoftwareEngineering Tagged: custom cell renderer, gtk, maemo, N900, Python, treeview, witter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/danielwould.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/danielwould.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/danielwould.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/danielwould.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/danielwould.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/danielwould.wordpress.com/695/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/danielwould.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/danielwould.wordpress.com/695/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=danielwould.wordpress.com&blog=3709593&post=695&subd=danielwould&ref=&feed=1" /><span class="net_nemein_favourites">7 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=f746e9c4f92511deb3ca9984bc0b66276627&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/f746e9c4f92511deb3ca9984bc0b66276627/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=f746e9c4f92511deb3ca9984bc0b66276627&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/f746e9c4f92511deb3ca9984bc0b66276627/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 02 Jan 2010 12:56:29 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-f746e9c4f92511deb3ca9984bc0b66276627</guid>
        </item>
        <item>
            <title>Maemo 5: Basic gesture support in python</title>
            <link>http://danielwould.wordpress.com/2009/12/19/maemo-5-basic-gesture-support-in-python/</link>
            <description><![CDATA[
<p>Once I got witter to the point that it had multiple views, I immediately wanted to have a nice way to switch between those views. In the first instance I just used buttons which have the advantage of being able to go direct to the view you want, but at the cost of screen space to show the button. Or alternatively needing to go via menus to get to the buttons.</p>
<p>Enter &#8216;gestures&#8217; I wanted to be able to swipe left or right to switch views, much like on the multi-desktop of the N900. So I did some searching and eventually found reference to <a href="http://gpodder.org/">gPodder</a> which is also written in python and introduced swipe gestures.</p>
<p>So i dug around the source and found that essentially they capture the position of a &#8216;pressed&#8217; event and the position of the &#8216;released&#8217; event and calculate the difference. If it&#8217;s over a certain threshold left or right then they trigger the appropriate method.</p>
<p>This seemed reasonable enough, but I couldn&#8217;t figure out what object was emitting those signals. As I looked into it I found something better.<br />
The hildon pannableArea emits signals for horizontal scrolling and vertical scrolling. And it does so regardless of whether it will actually scroll.</p>
<p>What this means is that for witter, I use a pannableArea to do kinetic scrolling of the treeview which shows the tweets. There is no horizontal movement, but I can use the following:</p>
<pre><code>
pannedWindow.connect('horizontal-movement', self.gesture)
</code></pre>
<p>Then in the method gesture I get:</p>
<pre><code>
def gesture(self, widget, direction, startx, starty):

    if (direction == 3):
        #Go one way
    if (direction == 2):
        #Go rthe other
</code></pre>
<p>those numbers do have constants associated, but I haven&#8217;t figured out where I am supposed to reference them from, so I&#8217;m just using the numbers.</p>
<p>The cool thing about this is that it is quite selective about what constitutes horizontal movement. Going diagonally left and up or down does NOT trigger this signal.</p>
<p>So it&#8217;s a pretty nice way to switch between views. Now I need to figure out how to do the cool dragging of views like the desktop, rather than just a straight flip of views.</p>
<br />Posted in maemo, project, SoftwareEngineering Tagged: gestures, hildon, N900, pannablearea, Python, swipe, witter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/danielwould.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/danielwould.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/danielwould.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/danielwould.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/danielwould.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/danielwould.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/danielwould.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/danielwould.wordpress.com/688/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=danielwould.wordpress.com&blog=3709593&post=688&subd=danielwould&ref=&feed=1" /><span class="net_nemein_favourites">2 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=e0bfd490f92511deb3ca9984bc0b66276627&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/e0bfd490f92511deb3ca9984bc0b66276627/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=e0bfd490f92511deb3ca9984bc0b66276627&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/e0bfd490f92511deb3ca9984bc0b66276627/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Sat, 19 Dec 2009 14:08:34 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-e0bfd490f92511deb3ca9984bc0b66276627</guid>
        </item>
        <item>
            <title>Custom cell renderer</title>
            <link>http://danielwould.wordpress.com/2009/12/16/custom-cell-renderer/</link>
            <description><![CDATA[
<p>As a teaser to a future post I thought I&#8217;d post an early screenshot of Witter using a custom cell renderer. This is about the first point at which my cell renderer is actually capable of showing tweets at all.</p>
<p>It completely lacks any layout of information, or colouring/sizing of text. But I wanted to put it up to a) contrast with when I&#8217;m done, and b) show that it took me nearly 200 lines of code, just to get this far&#8230;</p>
<p><img class="alignnone" title="Witter - with custom cell renderer" src="http://farm3.static.flickr.com/2675/4190137462_7a4a5c6055_o.png" alt="" width="480" height="288" /></p>
<br />Posted in maemo, project, SoftwareEngineering Tagged: custom cellrenderer, gtk, N900, treeview, witter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/danielwould.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/danielwould.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/danielwould.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/danielwould.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/danielwould.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/danielwould.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/danielwould.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/danielwould.wordpress.com/684/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/danielwould.wordpress.com/684/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/danielwould.wordpress.com/684/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=danielwould.wordpress.com&blog=3709593&post=684&subd=danielwould&ref=&feed=1" /><span class="net_nemein_favourites">2 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=d28c1974f92511deb3ca9984bc0b66276627&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/d28c1974f92511deb3ca9984bc0b66276627/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=d28c1974f92511deb3ca9984bc0b66276627&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/d28c1974f92511deb3ca9984bc0b66276627/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Daniel Would &lt;daniel@demigoth.org&gt;</author>
            <category>feed:85141068e640087e3494790d59181094</category>
            <pubDate>Wed, 16 Dec 2009 11:53:53 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-d28c1974f92511deb3ca9984bc0b66276627</guid>
        </item>
    </channel>
</rss>
