Status

Location
Arlington, VA
Subscribe to GeoRSS Subscribe to KML


Cocoa

More Web3.0 “The Desktop” links

Published in Cocoa, Programming, Project, Rails, Web


I talked a little while ago about the enlightening insight of understanding more about how the next phase of Applications will be “desktop-deployed web applications”. This was inspired/aided by listening to the brilliance of people like Matt Webb. Using standardized, hopefully cross-platform technologies, it’s possible to develop your application once, and “push” it to any number of devices.

Ajaxian discusses Adobe’s new “Apollo”:

Apollo is client-based software that will run Flash applications separately from a browser, whether online or offline

The image shows an example travel application developed in Flash, and deployed to a desktop via Apollo. (via Digital Backcountry)

I also saw that Chris Messina is helping out on a project WebKit on Rails, whose goal is to make it easier to deploy Apple’s WebKit and also to “come up with new ideas and practices that leverage the WebKit platform”. WebKit is an excellent platform to develop desktop web apps, as it can be baked straight into a Cocoa application, but be accessing a “web application” that may be running locally on the users’ machine.

rails-app-installer allows you to bundle and install/uninstall a Rails application, including required gems.

$ gem install my_app
$ my_app install /some/path


It’s like Testing Rails, but in Cocoa

Published in Apple, Cocoa, Programming


I rececently found out about BuildFactory. It provides tools like: continuous integration (ala Rails testing), building out of Subversion, and building multiple projects.

Another feature I’d really like to see in some grander build-tool is being able to link Cocoa projects to online bug tracking, like Trac, to link to the appropriate files/lines and changes.


DashSaver v1.2 released - Universal Binary

Published in Apple, Cocoa, Dashboard


I recently recompiled and released DashSaver as a Universal Binary. It now will run fine on Intel and PowerPC computers.

Go give it a download. There are still two major feature requests:

  1. Secure screensaver - when ‘Ask for password on wake’ is turned on, it will hide the dashboard
  2. Dual Screens - the semi-transparent, colored background under DashSaver won’t show up on the second monitor

You can also catch a great audio review of DashSaver over at the MacReview Cast (mp3, it’s at the beginning, the first reviewed freeware app)

Expect more features coming up soon.


Open-source Cocoa frameworks

Published in Apple, Cocoa, Open-Source, Programming


CocoaTech has released PathFinder 4, the ‘Finder replacement’ on Mac OS X (which is both hard since the Finder is baked into the OS and included, but easy since the Finder doesn’t really provide much actual UI). I haven’t used PathFinder much before, since it had publicly stangated on v3 and I am happy enough with the Finder and the awesome ability to press <Cmd>-<Shift>-G to bring up a tab-completing text entry for going to locations.

But what really impressed me was their new Open Source projects. Their open-sourcing their plugin-in interface, their internal and powerful frameworks, and CocoaTechTerminal which allows developers to put a terminal within an NSView in their applications.

A company with solid code, releasing parts of their code-base in open-source is unadulterated awesome and much to be applauded. I’m downloading PathFinder 4 just because of their open-source coolness and will give it a try and may purchase it.

Since I’m on the topic of people making very developer friendly add-ons, I recently came across John R Change Contributed projects, which include a better NSStream, a case-insensitive NSDictionary, a category of NSString that adds support for matching regular expressions, and other Cocoa add-ons and classes.

There are many, many more libraries out there. Just watch CocoaDev, a developer Wiki that is active (if sometimes chaotic) documentation, discussion, and resources on Cocoa libraries.


Adding SpeechRecognition to your OS X App

Published in Apple, Cocoa, Programming


Mac OS X has long had (rumor has it in the dark days of pre-X) excellent speech recognition and speech output capability. There is no training involved, it just works. The OS supports it, many apps support it. It’s great.

To enable speech, go to the Speech preference pane (you know the drill, <Cmd>-<Space>, Spe, <Enter>) and give it a drive. Great commands like “What time is it?”, “Tell me a joke”, or “switch to finder”. Ok, so those aren’t great. People really just think you’re weird for shouting at your computer.

What I’m here to tell you to day, avid reader (yes singular, “Hi!”) is that it is incredibly easy to add this capability to your own Cocoa applications.

Apple’s Developer Docs: Speech presents that basics, but leaves out a couple of important points.

1) Insert an NSSpeechRecognizer in your apps/class’ interface definition (hint: it’s the .h file)


	NSSpeechRecognizer* recog;

2) Intialize the recognizer and specify the commands your app is looking for:


- (id)init {
    self = [super init];
    if (self) {
        NSArray *cmds = [NSArray arrayWithObjects:@"Forward",
                @"Stop", @"Left", @"Right", @"Backwards", @"Roll over", nil];
        recog = [[NSSpeechRecognizer alloc] init]; // recog is an ivar
        [recog setCommands:cmds];
        [recog setDelegate:self];
    }
    return self;
}

In this example I used the great commands, “Forward”, “Stop”, and “Roll over”. ;)

3) Add the speechRecognizer: method which is what gets called by the system speech recognizer trying to figure out if your app knows what to do with the user’s jabbering:


- (void)speechRecognizer:(NSSpeechRecognizer *)sender
didRecognizeCommand:(id)aCmd {

	if ([(NSString *)aCmd isEqualToString:@"Forward"]) {
		NSLog(@"Forward called");
		   return;
    }

    else if ([(NSString *)aCmd isEqualToString:@"Stop"]) {
		NSLog(@"Stop called");
        return;
    }
    else if ([(NSString *)aCmd isEqualToString:@"Roll over"]) {
		NSLog(@"Rollover called");
        // .... some response here...
    }
}

4) Add startup and cleanup code:
awakeFromNib:


	[recog startListening];

awakeFromNib:


	[recog dealloc];

Now run your app, open the “Speech Command Window” and your app should be in there. Start speaking and your commands will get called (NSLog is a good debugger for this).