Learn to Stop Worrying and Love the Singleton

Fredrik Olsson

Enterprise applications and mobile applications have quite different requirements. Starting an enterprise application is just something you do once before it continue running for months or years. On the other side of the spectrum most mobile applications seldom runs for more than minutes, run by a bored users standing in line or riding the bus. [...]

Tags: , , , , ,

Google Translate and iPhone apps

Fredrik Olsson

The Cocoa and Cocoa Touch frameworks has a really nice function for acquiring a localized string NSLocalizedString(). Just pass in a key and you are done, for strings that are known at least. Sometimes you are getting unknown strings from a data source not under your control, strings representing just a fraction of the text [...]

Tags: , , , , ,

The BROWSABLE category revealed

Mattias Rosberg

Assume that you on your desktop computer browse to a web page with the following page source

Clicking on the first link you expect your browser to start a new tab and navigate to the url that was specified in the href. If you click on the second link you would expect that the browser opens [...]

Tags:

Add some polish to iPhone app start up

Fredrik Olsson

First impressions last, and the very first impression your users have of your iPhone application is the start up. First step is to have a nice Default.png, but not many words spilled on that one, it is well covered in Apple’s documentation.
Creating a perfect Default.png is impossible, especially if you have different setup of navigation [...]

Tags: , , , ,

Queued Background Tasks for Cocoa

Fredrik Olsson

The megahertz race is over, and instead we get more execution cores. This means that we as developers must make our applications parallel, in order to take advantage of the new performance. The easiest way to be parallel is to execute tasks in new threads, something that is useful also for lengthy but not resource [...]

Tags: , , , , , , , , , ,

Regular Expressions and Cocoa

Fredrik Olsson

Regular expressions is a powerful tool for solving many problems related to text. It can be misused as any good tool, but there are moments when they are the best solution for a given problem. At those moments the lack of regular expressions for Cocoa on Mac OS X and Cocoa Touch on iPhone OS [...]

Tags: , , , , , , , , ,

Working with SD cards in the Android emulator

Mårten Österberg

Working with external storage in the Android emulator could be a little tricky and the documentation is not easy to find. I’ll try to give a brief walk through of the steps needed to create a SD card image, mount the image in Linux, put content on it and use it in the emulator.
Creating [...]

Tags: , , ,

Adding Sorted Inserts to Cocoa Arrays

Fredrik Olsson

NSArray and NSMutableArray have methods for sorting arrays, NSArray returns new sorted arrays and NSMutableArray can be sorted in place. The sort methods comes in three flavours; using a function, using a selector, or using an array of NSSortDescriptor objects.
NSArray admits to sorts being a slow operation, and adds a method pair for comultive sorts [...]

Tags: , , , , , ,

Layout resources in Android

Mattias Rosberg

One thing that often confuses developers new to the Android platform is the handling of layout resources. The xml files describing the layouts are magically transfered into a more efficient binary format behind the scenes and hidden away – leaving the developer with a static reference to the resources via the R.java file.
By using the [...]

Tags: , ,

Bridging the Gap Between Java and Cocoa

Fredrik Olsson

Many Java developers are looking at new dynamic languages, such as Groovy and JRuby, mostly because of the freedom and rapid development that a dynamic language allows. Some of my colleagues are also looking at Cocoa and feel daunted at the sight of Objective-C.
Here I will use a small example that is easy and [...]

Tags: , , , , , ,

UIToolbars in iPhone OS 2.x

Fredrik Olsson

The new release of iPhone OS 3.0 adds some nice API:s for managing a contextual toolbar. This is well needed as toolbars in the current iteration of iPhone OS is not only poorly documented, it is also quite hard to do right. So I will go over how to do toolbars the right way, for [...]

Tags: , , , , , , , ,

Hidden methods in Sony Ericsson Java Platform

Fredrik Olsson

It is no secret that the published interfaces for MIDP classes in any JavaME Platform is only a subset of what in reality is there. Most of the native calls needed to interact with the underlying native platform, and other helper methods, are hidden from us. Mostly for good, and sometimes for bad…
The Anecdotal History
We [...]

Tags: ,