Mobile Development

What makes a good programmer?

These are some of the things I think make a good programmer:

  1. Don’t tie yourself down to 1 language. The programming language is your tool, just like a hammer is to a builder. You should always use the best tool (language) for the job at hand. Every new language leads to new ways of thinking, and better ways of doing things.
  2. Programming is not just your ‘job’. I’m happy to accept there will be exceptions, however in my opinion if you only program for your job, then you will never be a great programmer. All the greatest programmers I have met, they ‘live’ programming. Note this does not mean you’re supposed to code 24/7, but if you really enjoy programming, then you’re likely to be doing it outside work too.
  3. Understand that there is usually a better way of doing things, but sometimes you have to find the balance. Its not always best to spend 6 months writing an awesome bit of code, sometimes you have to be able to analyze whats really needed. Your time might be better spent writing a rough prototype of the code, so other members of the team can get started quicker. You can always go back to re-factor it later.
  4. Learn to analyze and predict problems in advance. When your making changes, think of the repercussions and how it effects other parts of the code.
  5. Test your code properly. A QA team is no excuse for not testing code properly yourself. Ideally you should also have some way of automating tests too.
  6. Split up problems into management chunks. If you have a long list of things that need changing, try to split them up into completely separate tasks. Its very easy to start making too many changes in one go, and then it gets confusing when things go wrong (at what point did I break that bit of code, was it fix A, B or C??). The best way, is to make small changes that do not break the code for long periods of time. This way changes can regularly be committed to revision control, which makes life a lot easier when you need to track your changes to find the source of a bug, or roll back to a earlier version.
  7. Don’t be a rebel, respect the existing code style. If you are working in a team, you should all be working to the same code style. Being a rebel and going against the grain is not smart or clever. You might think that your code style is superior, but no one cares! Code with 1 consistent style is much easier to read, than one with 10 different code styles, from 10 different programmers who all think they know best.
  8. Work well with others and respect other people’s views and abilities. Programming is as much about being able to work on your own, as it is being able to work well in a team.

Stopping comment spam

Over the past few days I’ve been getting over 100 per day spam comments from bots. They don’t show up until moderated, but I get an email for every single one, and I have to manually mark them for deletion.

So I installed a Captcha plugin for wordpress, which will hopefully stop those bots from posting for a while :)

If you add a comment, you should notice a image verification box, which you’ll need to show for your comment to be accepted.

Nokia invalid JAR

Quite a fun problem.

Installing an application from the JAD says invalid JAR on some Nokias, but installing direct from the JAR works fine.

The problem as it turns out, is that there is a bug on some Nokias where if the version ends in a 0 (i.e 1.1.0), it says its invalid.

Very stupid, and very annoying bug. Thanks Nokia

Ruby Kernel.fork on Windows

Kernel.fork is used to start a subprocess, which is sometimes needed over just a Ruby thread (which is still part of the current process). Unfortunately it doesn’t work on Windows because Windows doesn’t support the fork(2) command.

However, it does work under cygwin! Which is really useful :)

Automated Blackberry sign tool (Mac, Linux & Windows)

There is a way to get Blackberry to be built and signed, on Mac, Linux & Windows. Heres how:

BB Ant tools

Need I say more? Well for the most part no, these tools work exactly like described. All you need is the JDE bin and lib folders, and the ant tasks for bb-ant-tools.

However if you need to get the signing tool to work, there is a little bit of info you need to know:

The signing tool looks for 2 files: sigtool.csk and sigtool.db
These must be in the bin folder for the JDE, alongside the SignatureTool.jar.
If your on windows, this works fine. If your on mac or linux, this doesn’t. Why? Because the SignatureTool is stupid.

It looks for the files like this: “..\bin\sigtool.csk”. So on anything that doesn’t use \ for dir seperators, this doesn’t work. You can trick it though, by making a softlink:

% ln -s bin/sigtool.csk bin\\sigtool.csk
% ln -s bin/sigtool.db bin\\sigtool.db

The signature tool now finds the files, yay!

Most people think the signature tools are restricted to your machine. However they are not. The csk and db file can be put on any machine, and the signatureTool will work. Be careful you don’t distribute your registration files though, because thats what RIM use to trace a malicious application.

For our development, I have put the JDE’s bin and lib folder into our subversion repository. So all developers can sign and build without needing to install the JDE, and it doesn’t matter what OS they are running either :)

Hope this is useful to someone, because theres not much info out there on BlackBerry development on other OS.

J2me threading issues on Nokia S60

Had a strange thing happen with the Nearme app I’m working on. When installed onto the phone memory, the app is blistering fast on my N95. But when installed onto the mass memory (memory card), it runs incredibly slow during network activity.

It just sounds like bad threading code, but the GUI and the network are in separate threads and considering it runs very well on phone memory, and on other handsets, it leads me to believe its an issue with j2me apps on the memory card.

I will post an update once i’ve gotten to the bottom of it. I’d be interested to hear if anyone else has seen this.

N95 sync on Mac

I asked myself a question: “Hmm, I wonder if its possible to sync my N95 with my mac”. My answer: “Doubt it”

Funny that, I am now not only able to sync my N95 with my Mac, I also don’t need todo anything because it does it all automatically when I move my N95 within bluetooth range of my Mac. I love my Mac :)

For those wondering how I did it, I followed this useful guide that pretty much walked me through it. To summarise what you need from that post:

  1. iSync

    This was already on my Macbook with Leopard.

  2. Nokia N95 plugin for iSync

    This was probably the only step that caused me problems. The latest version of iSync is 3.0, and Nokia’s iSync plugins are only for 2.4. So in the end, I had to purchase a plugin from here. It was only 8 pounds though, so for me it was well worth it.

  3. Home Zone

    This is what detects when your device gets in Bluetooth range and starts a script. You can get it from here.

  4. Automator app for the sync

    You can get this from here. You just need to unzip it, and put it in your Applications folder (or somewhere you can find it).

I recommend following through the guide though, its pretty straight forward :)

Over the Air - Wrap up

So what did I think of Over the Air?

Well I will definitely be going next year, thats for sure. It was great fun, and very informative too. When your so focused on developing a product, its sometimes easy to loose track of the bigger picture. Events like these really help to keep an open mind, and keep things in perspective. Its also great to meet other developers in the same space, and exchange ideas.

A big thanks to everyone who help setup Over the Air, I really enjoyed it :)

Over the Air - Silly glasses

This session was with Dr. Paul Coulton of mobileradicals - Lancaster University. Despite the misleading title, it was not a talk about big purple sunglasses! It was about creating uniquely mobile experiences.

And it was great.

The session was really thought provoking, and ideas where whizzing through my head almost constantly.

I really encourage you to check out the mobile radicals website, and have a look at the different projects they’ve got there. There is some really interesting stuff. Experiments with RF Tags, Accelerometers, etc. There is so much scope outside of what we’ve got on mobile today.

Over the Air - Visual Design on Mobile

This session was with 2 guys from Idean; Petri Heiskanen and Harri Lehmuskallio.

I think this was a fantastic session. It was great how the discussion evolved into a open dialogue between the speakers and the audience, and for me it was really great to see interaction between an artist and a user experience designer.

The biggest thing I got out of this session, was it has allowed me to change the way I think about UI design. Typically (and stereotypically in fact), a programmer tends to design a UI around functions, and sometimes you can easily see a UI that has been designed by a programmer. I’m not trying to slag of programmers, everyone is different, but generally programmers are not good at UI design.

After this session, I found myself thinking about UI design in a totally different way (i.e the user’s experience, not features or functions). “Right, I want this application, and I want it todo this!”.

It has also opened up my eyes to the importance of a user experience designer/engineer. This is something Steven has been saying for a while, and after this session, I can so clearly see the benefits of having someone purely as a user experience engineer, where as before I had trouble seeing it outside the role of an artist. The 2 things are so so different, they are not the same!