BeTrains / Project iRail, my first steps in iPhone development

Filed under BeTrains, iPhone, mobile

As I gained more and more interest in the use of the mobile solutions, I went to some events organised on the matter this year.

I went to a mobile barcamp ( and met Christophe Versieux, an enthousiast Android developer. He had already had developed « BeTrains », an android application which makes it possible to consult and plan your trips using the belgian trains (try it here). What amazed me was that all the data provided in the application was parsed by the android application without any help from a dedicated server or api. Christophe gained some respect from me for this, as I know how difficult it is to parse data in general.

We kept in touch during the following months, talking about mobile dev, his application. I tried to begin some Android dev with no great succes … I was more attracted by the iPhone dev. It takes a lot of time to get acquainted to some new technique, and as I tried some objective-C tutorials I rapidely realised how difficult it was. Objective-C has a completely different syntax than the web languages (php/as3) I’m used to.

As the company I work for (iFood) got more and more interested in mobile development, I was sent to follow a 3-day iPhone dev course given by Aral Balkan. What a blast ! I never expected to learn so much in only 3 days. We didn’t see all the aspects of the iPhone dev, but we learned the logic behind it. This gave me sufficient knowledge and motivation to continue my quest in developing my own iPhone apps.

By september I got some news from Christophe. He told me some hardcore web developers had build an API around the belgian trains. « Project Rail« , the name of their API, makes it possible get access to the departure/arrival times of the belgian trains and the available stations in a very clean way (xml format).

I met the guys of the project iRail around september and was pretty amazed how simple their api was. As I was looking for a concrete projet to practice my objective-C skills, it seemed more and more obvious that making an iPhone version of the « BeTrains » application was an excellent opportunity. So I joined the team !

After 3 weeks of intensive coding I finally managed to get a working beta-version of the application. I can’t tell you in detail how much I learned during that time: how to properly use the « UI » components, using online data (DB requests, image loading), debugging and optimising my code code …
For every problem I encountered I always managed to find a solution simply by googeling. After all this time I can’t tell you how much I enjoy the coding experience, the logic and overal constance behind the use of the language, and most of all, XCode, the tool used to build application. I’ll certainly post an article about how I configured it and how using some external tools made my life so easy.

So back to iRail, we had a second meeting last week during which I presented my work in progress. The team was enthousiast about what they saw.
I hope to submit the app in the following weeks, I’ll keep you updated !


I now leave the word to Pieter Colpaert who made a report about the meeting:

iRail meeting 2: 20:30 – 24:00
Attendees: Yeri Tiete, Tim Besard, Louis Dedecker, Pieter Colpaert, Pieter De Baets

As a lot of people were sick, were excused or were experiencing traffic problems (the team really should learn how to use public transport ;-) ) we started late and we did not respect the schedule at all. Louis
de Decker started of by showing the BeTrains for iPhone application. It looked great and user-friendly. It already shows the right train information and even implements the same chat-with-people-on-your-train functionality like BeTrains for Android. I hope he will reply on this e-mail with some screenshots. We were unanimously excited about his progress and we hope to see more soon. We expect an official release before the end of this year.

The second presentation was held by me (Pieter) and the slides are attached to this e-mail.
Points worth mentioning:
* We got a new logo for both BeTrains and iRail! Thanks to OlivierGuiard who joined the iRail team
* We need more design people. Our design atm is not one to be very proud of. To be fairly honest, it’s ugly. Think you can do better? Think you know someone who can do better?
* We got a proof of concept with jquery mobile here:
* We lack PHP developers! Are you interested in helping out on the API? Please contact me as we still have quite some work on that.
* We want more users!
? Qr code campaign: We’ll distribute stickers (probably give the maway for free) which you can scan with a smartphone and retrieve the information of the station you’re close to. You can put these stickers on your bag, on your train subscription, …
* We want more developers who use the API   
? We’re going to do a developers challenge sponsored by X: the most creative work wins. No rules, no limitations.
* We want other people to blog about us. Blogging about ourselves again leads to the same people reading the same things over and over again. We will be happy to do phone-interviews with anyone and we will be happy to answer any question
* We might start an non profit organization to back our project. This way we can legally accept tasks from other companies and we can accept donations/investments. We got some offers which we might accept to implement and optimize public transport site plugins.

The third and last talk was about BeTrains for QT (=maemo, symbian, meego, …). Tim Besard is doing an awesome job. His approach is at this moment to first write a very good back-end (something that accepts requests and talk with the API). Writing front-ends is another specialty. He could show us a 0.1 version of a maemo front-end which was quite nice and promising. We will implement a chat-system, like in other BeTrains apps as well. We hope Tim will post some screenshots for the rest of the world. Recently we started development on a samsung version of BeTrains: BeTrains for Bada. If you have a bada-phone let us know and we’ll keep you informed as a test-user.

The last subject of the evening was discussing the iRail API after we released the new draft one month ago. We came up with this:
* A demand for JSON output. This is no problem and I will implement this asap. (=ticket #29)
* Need for a unique Id for a station. At this moment it is not clear whether Gent Sint Pieters, Gent SP, … are in fact the same stations and it’s hard for a client developer to know that. Therefor we will link all stations with a unique Id. This Id will be similarly constructed like the Id of vehicles, for example: Be.NMBS.Station.123* We need liveboards! (Arrival/Depart boards)
* As we are excited about the chat functionality of the BeTrains applications we will adopt this in our official API soon. It will be at
* For the xml part it would be nice to have XSD’s
* When doing xml API request I want to see some eye-candy. Please implement an XSLT
* Porting the API to the Netherlands is easy. Why not do it since wehave As our iPhone app will be free we can be an alternativefor the proprietary dutch iPhone app that costs X€.


* We need to make a clear distinctions between people who actually use the API and people who develop the API.
* will be directed to our servers and there will be a BeTrains .com/.mobi site soon.
* We need to be more visible on facebook
* is not sexy at all. Is there a way to change the theme of a trac?
* To have more visibility we should create a good drupal and wordpress plugin. A lot of people us those systems and it would be awesome to see people using it to find the best public transport way to get at their location.
* We will provide a demo widget soon
* Next meeting will (probably) be in Hackerspace Brussels

Yours sincerely,

Pieter Colpaert

One Trackback

  1. [...] This post was mentioned on Twitter by Louis de Decker and Christophe Beylemans, Pieter Colpaert. Pieter Colpaert said: RT @louisdedecker: Check out my new blog post: "#BeTrains / Project #iRail, my first steps in iPhone development" [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *