Conifer Productions

From ideas to apps. From mobile to global.

Goodbye vCard, hello jCard!

The vCard format has served us well for encoding and exchanging contact information, but there is a better alternative – jCard. In this post I’ll describe why I think jCard can be better than vCard, and should be adopted by every software vendor who deals with contacts. Both vCard and jCard are text-based formats, but whereas vCard has a unique legacy grammar, jCard is based on JSON. They both represent essentially the same data model that describes contact information: name, phone number, address, e-mail, and so on. Read more →

Photos framework and HipStyles

HipStyles was removed from the App Store over a year ago, but from time to time I still think it could be resurrected. However, after taking a long hard look at Apple’s new Photos framework in iOS 9, I think it is just not feasible anymore. HipStyles and the Assets Library Framework HipStyles was a photo finder for Hipstamatic and Oggl photos, looking for snaps taken with some Hipstamatic lens, film or flash of your choosing. Read more →

Find the API and Use It

It all started with an idea, something to scratch a personal itch. I was learning elementary French, and realized that there is an algorithmic approach to generating the numbers. Not a very elegant algorithm, but one that could easily be turned into a computer program.

The idea turned into a function, and soon enough it turned into an iPhone app, now called Les Nombres and available from the App Store (and also for Windows Phone). My function takes a nonnegative integer and turns it into a French language string, which is displayed on the screen. It could be fed into a speech synthesizer, but in Les Nombres the numbers are recordings of a native French speaker, which I think is nice. (And I couldn’t use recordings of Apple’s “Virginie” voice from OS X anyway due to its license.)

To keep things simple, Les Nombres only deals with the numbers 0 to 100, even though my function could do up to 1,000 out of the box. It involves some 90 lines of Objective-C code, including two recursive calls. It was fun to write, and I learned something in the process, but ultimately I didn’t have to write it at all.

Read more →

Formatting numbers is easy

When you have some numbers that you need to show in your user interface, you shouldn’t just stick them in a string using whatever old library function you happen to have. Especially printf in C, toString in Java, and others like these are only suitable for debugging, because they have no idea about how to format numbers properly according to the user’s regional settings. The ways to write numbers have differences across languages and countries, especially with the characters used to separate the whole part and the decimal part, and also with regard to how large numbers are grouped to make them easier to read. Luckily you don’t have to figure out the details yourself.

Instead of traditional programmer-style functions, use the convenient API methods provided by your platform. They do all the heavy lifting and work out the details for you. For example, in iOS you use NSNumberFormatter class from the Foundation framework. Since iOS 4.0 it has offered a very nice way to get a locale-specific representation of a number so that it honors the current user settings. NSNumberFormatter has a class method called localizedStringFromNumber:numberStyle:, so you can use it without even creating an instance of the class.

Read more →