RSS Feed!

Recent Posts

Recent Comments

Author Archive

Versionsapp (Subversion) and Static Libraries

Tuesday, June 1st, 2010

Ever since the kind people at versionsapp.com have given me a free license to use their awesome product I have been enjoying it a lot.

Today I imported an existing iPhone project and then checked it out again. To my surprise when I tried to build it I encountered an error. I checked  my SVN repository and discovered that a static library ( .a) was not there.

Apparently .a files are treated as hidden files and they don’t get added to the repository. If you want to “fix” this in Versions app then select View -> Show Ignored Items (⌘ + ⇧ + I) and then simply add and commit.

It’s not hard, you just need to know what to look for.

Cheers…

AKL Transit

Friday, May 14th, 2010

I was going to send a tweet instead of posting here but 140 characters would not have been enough…

The Auckland Transit iPhone and iPod Touch application has been in the app store for a few weeks now and it’s already providing me with some very interesting statistics.

Unlike Wellington, most of the iPhone users are NOT using a 3GS model but 3G rather. The number of jailbroken devices is 4 times the one in Wellington and, more interestingly, whilst in Wellington the peak is Mondays or Fridays in Auckland it seems to be Saturday instead.

Monitoring user behaviour between Wellington and Auckland will be an interesting exercise, especially since the Auckland user numbers are growing so rapidly.

Wellington – Real Time Public Transport Information

Sunday, February 28th, 2010

WelliBUS users have been asking me for real time bus info ever since WelliBUS was first released a long time ago.

I have been in touch with the Metlink people (who are just awesome) but sadly the information will not be available any time soon, and even when it will become available 3rd parties will probably have to wait even longer (unless they decide to start scraping HTML).

So after doing some thinking I have decided to try and implement it myself. Yup, I am indeed crazy. The craziest part is that I believe that this could work, especially if you get involved. At the moment 4000 of you are using WelliBUS and I would like to thank each and every one of you. Most of you are using iPhones, the rest are on iPod touches and Android devices. Although this is intended mostly for iPhone users there are scenarios when even an iPod touch can be used (WiFi on the bus, Free Wifi Hotspots, etc).

If out of 4000 people just 2000 decide to use this system I am sure we will get pretty good coverage, especially at peak times when we need it the most.

I have already starting implementing this which is why I am asking for everyone’s help. Please post comments below to tell me what you think, what I should and should not do, what you think is most important in the first release, what I missed out on, whatever you think might be useful. Once you’ve done this please spread the word. Don’t forget to download WelliBUS if you have an iPhone, iPod touch or Android device.

Here’s how I was thinking that it would work.

User waiting for the bus:

  • Starts the app and selects the bus stop number they are at and also the service numbers that they want a notification for.  (e.g. Stop 5002 – St James Theatre, Services 1 – Island Bay, 46 – Broadmeadows, 54 – Churton Park)
  • Either leaves the application running (at least in the 1st release) or closes the application and waits for a push notification (future release)

User traveling on the bus:

  • After getting on the bus the user selects the service that they are on and taps “I’m on the Bus“. (e.g. select stop 5000 – Courtenay Place, Service 54 – Churton Park)
  • User leaves the application running and can alternatively see on a Google Map view as the bus travels towards its destination
  • User sees a Good Citizen points indicator. See how the points work below.

WelliBUS will:

  • Notify the user in stop 5002 that a service 54 – Churton Park is on its way and reports the approximate distance between the stops
  • Reward the user on the bus 1 Good Citizen point for having helped another traveller find out when the bus was coming. The more people use the information broadcast by the user on the bus the more Good Citizen points the users get. All users that broadcast their location on the bus will get “rewarded”
  • Provide a Good Citizen ranking system (users can register and submit their points to our server)

Good Citizen points:

  • A user that leaves the application running while on the bus (between start and stop) will accrue 0.5 points for each stop they pass by
  • If at least another user is on the same bus and broadcasts the information then all users receive another 0,5 points
  • For each user that is notified about the bus that the Good Citizen is on then another point is awarded.
  • Sponsors can reward Good Citizens: e.g. maybe Snapper can give them extra credit, maybe Metlink could discount a monthly pass as long as a minimum number of points is accrued the previous month. Other sponsors can be as creative as they want. The rewards should be provided in exchange for Citizen Points. The claimed points will go towards a Sponsors Ranking. (e.g. If my favourite coffee shop in Wellington, Mojo Old Bank give a free coffee for every 200 Citizen Points then their points value will go up by 200 every time they offer a reward. This is a rough guide at the moment)

Cheating:

  • If a person is in a car rather than on a bus then the application will detect the car speed, missing the stops, and other similar checks
  • If somebody does manage to fool the “system” the other people will be able to veto them. e.g. if user A reports being on a bus that never reaches user B although it should then user B will be able to give thumbs down to user A. The more thumbs down the slower the user accrues Citizen points. Eventually a lying user can be removed from the system.
  • Other “punishments” could be applied. Be creative!

You can:

  • Donate. You can help the development of this feature by contributing with funds.

  • Spread the word! Nothing is more helpful.
  • Twit about this. Here’s an example Help Wellington get Real Time Public Transport information. http://bit.ly/9pq2v3 Please RT
  • Post a link to this post on your Facebook wall. For example you could post Make Wellington the first city in the world with real time traffic info driven by us. Details here http://bit.ly/9pq2v3
  • You could sponsor this project. There are many ways in which you can help. First email office [at] tmro [dot] net and we will take it from there.
  • You could buy ads in WelliBUS. Your business logo and a 1 sentence message could be displayed on the Map View close to a relevant stop.
  • You could help in ways I haven’t even thought about.

Cheers…

WelliBUS updates and other news

Thursday, February 11th, 2010

This past week has been a very active week in terms of deployments.

iPhone WelliBUS reached version 2.5.1. The latest update adds a new feature that allows users to save favourite services not just stops, improves the load times significantly, brings tooltips to a few screens and addresses a couple of small issues.

But the real reason for this post is that this week we launched two Android applications.

Firstly WelliBUS for Android was launched! This first release of the application is very feature rich thanks to the work of @cur3n4 Users can search by stop numbers, station names, street names and even wharfs. There is even a Map view that allows users to find nearby stops. Once the departure stop has been identified the application allows filtering by service number or date/time and goes on to display the departure times and itinerary for the selected routes. Download this free application from the Android Market today.

The other application is the Android version Twister Referee. This is a port of the iPhone application with the same name. Its purpose is simple: enable referee-free Twister play. Rather than having one player operate the spinner the application will do it automatically, over and over again.

Cheers…

Reviewing a MyFreeview|HD DVR

Sunday, November 15th, 2009

After Mauricio (the Geekzone BDFL) asked me to review the JCMatthew DVR-320T I wasn’t sure what to expect. Now I can honestly say that I am happy to do this. I will try to be as impartial as possible and provide the readers with a no-nonsense review. My tone will be as non-technical as possible and I will strive to explain the slang as clearly as I can.

So I’ve started this reviewing journey that you can follow here. I will not be cc-ing my review to this blog but I will be taking questions via this post if there are any.

So feel free to drop me a line if you feel like it.

Cheers…

Solved: Mac OS X (Snow Leopard) and SVN (1.6.2)

Friday, November 6th, 2009

Today I spent a few hours trying to figure out why Eclipse was unable to connect to my locally running Subversion server. I was annoyed especially because Xcode and Terminal were not having any issues.

Some background information.
- SVN is running as a daemon locally. It gets started by:
svnserve -d –listen-host localhost -r /Library/Subversion/Repository

- trying to checkout stuff using the command below via Terminal works fine
svn co svn://localhost/Project1/trunk WorkingDirName

- trying to browse the svn repository from within Eclipse 3.5 Galileo using either Subclipse or Subversive always ends up with:
svn: connection refused by the server

I tried many things but none of them helped. I googled but failed to find something relevant. Just before giving up I thought I would check what ports were open on my machine, maybe there was some conflict. There was no conflict but…
netstat -anp TCP | grep LISTEN
returned this:
tcp6       0      0  ::1.3690               *.*                    LISTEN
That’s when it dawned on me: the svnserve was binding an IPV6 address and Eclipse could not handle that!

Solution:
ps -ef | grep svnserve
kill -9 (where proc_id is the process id of your svnserve, the second number on the line)
svnserve -d –listen-host 127.0.0.1 -r /Library/Subversion/Repository/ (or wherever you’ve placed your Repository)

Done! Now svnserve is bound to an IPV4 and Eclipse can play nice too.

Cheers…

p.s. please let me know if this worked with other Mac OS / SVN versions too

Mac OS and Java Me SDK 3.0

Wednesday, November 4th, 2009

Sun have released not too long ago a Java ME SDK 3.0 that finally brings an official Wireless Toolkit Emulator to the Mac platform.

I have been dealing with SUN software for a while now and I was not expecting this to be a smooth ride. Those who’d dealt with the WTK on Windows/Linux platform are well aware of the limitations of these emulators. What I was not prepared for was to get so much clutter that would just not work more than a couple of times.

First impression: this wtk looks like the most polished emulator ever released by Sun.

Sadly, after using the thing for a few days I discovered that the old habits had not changed:

  • there is no menu entry to run an existing jad/jar pair. You have to right click on an emulator instance and then run it…
  • you cannot set-up a project starting from a jad/jar pair. There used to be an option to do this back in wtk 2.2…
  • after running a couple of apps the whole thing crashes an burns
  • when closing down the wtk a process is left lingering. Run this in a terminal:  ps aux | grep device-manager.app
  • switching the verbose mode when launching the emulator kills the whole thing dead!
  • they bundled ant 1.7.1 with the distro although ant is built in Mac OS
  • Permgen errors are thrown if you try to launch the app too often. LOL

Here’s what happened when I created a new project and tried to run it:

*** Error ***

Failed to connect to device 0!

Reason:

Emulator 0 terminated while waiting for it to register!

The same thing happens with Emulator 1 and 2 and 3 and 4 and 5 and 6 and … you get the picture.

Googling did return lots of forum posts, but hardly any answers…

So after wasting more than 2 hours on this issue I did the unthinkable: rebooted my mac! To my surprise the miracle happened during the reboot: I was finally able to run the project again.

Needless to say I am very disappointed but not surprised by the quality of this, early access, Java ME SDK.

Cheers…

Updating the UISearchBar programmatically

Friday, October 16th, 2009

Today I had to update WelliBUS’s search bar programmatically because I needed to use the street picked up via GPS as my street name.

Until this point implementing the search bar seemed easy:

  • adopt a couple of protocols: UISearchDisplayDelegate and UISearchBarDelegate
  • implement a few callback methods (from the delegates listed above)
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString;
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption;
- (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller;
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller;
  • and implement my own filtering function
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope;

The problem I had on my hands was how to programmatically update the text in the UISearchBar and force the UISearchDisplayDelegate to call the appropriate callback methods.

Turns out it was simpler than expected (despite not being able to find a solution by googling). All that was needed was:

[self.searchDisplayController.searchBar becomeFirstResponder];
self.searchDisplayController.searchBar.text = returnString;

Cheers…

JSON Framework — Potential Null Dereference

Monday, October 5th, 2009

If you are using json-framework as your preferred iPhone / Cocoa Touch JSON framework then you might find that the SBJSON.m is not necessarily perfect.
Don’t get me wrong, it is an awesome utility and it has saved me heaps of time but when analyzing the code (with XCode 3.2) I got lots (36 or so) of Potential null dereference warnings.

The reason for it is that when this the error is built in lines like this:

*error = err(EUNSUPPORTED, @"JSON object key must be string");

The error object is not checked for NULL.
According to Apple’s documentation one can call a method that takes a error:(NSError**)error parameter with either of these:
NULL
NSError *error = nil;

So if the argument is NULL you can’t really assign something to it.

To fix the XCode warnings (and your code) just do this test before the call to create a new error object.

if (error != NULL)
  *error = err(EUNSUPPORTED, @"JSON object key must be string");

Cheers…

Urban Airship – Push Notifications

Sunday, October 4th, 2009

Today I have finally added Push Notifications to Parcel Trackr.

I decided not to waste time and I went for Urban Airship. I registered, uploaded my push certificate, downloaded the sample and integrated the two systems.

Not everything went smoothly though because when I first ran the application I got a

Failed to register with error: Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0×120610 “no valid ‘aps-environment’ entitlement string found for application”

I thought my provisioning profile did not include the right entitlement… so I re-downloaded it and tried again. Turns out I was using the wrong provisioning profile.

So if you want to avoid my mistake just make sure that after you’ve configured push services in the iPhone Dev Center you download the updated provisioning profile and then you install it via XCode.

Other things worth checking include: the product name in your build configuration matches the app id and of course, the ultimate solution, clean all targets before building!

Cheers…