How do you switch screens in a BlackBerry application?
You’re writing a BlackBerry application with several screens. How do you change from one screen to another?
If you are in the event thread (the default thread your program runs on if it’s a UI application and you haven’t started any other threads), then opening up another screen can be done by calling the pushScreen() method of the UiApplication class.
Since, in a typical case, your application derives from UiApplication, you would take a reference to your application object and call pushScreen() on it with the parameter of your new screen:
myApp.pushScreen(new MyNewScreen());
If you’re running in a worker thread, or in any context where you either don’t have access to a UiApplication or pushing a screen would not be allowed (you’re only allowed to work with UI components on the original UI thread), then pushing a screen onto the screen stack is a bit different — you need to switch to the UI thread, and then push the new screen onto the screen stack:
Application.getApplication().invokeLater( new Runnable() { public void run() { Ui.getUiEngine().pushScreen(new MyNewScreen()); } } );
At Antair, we have a simple ScreenChanger class that’s part of a larger internal library that we use for all of our projects. Here’s a stripped-down version of the ScreenChanger class for you to use.
// ----------------------------------------------------------------------------- // // Antair Library for BlackBerry Devices // ScreenChanger.java // Copyright (c) 2005 - 2011, Antair Corporation. All Rights Reserved. // // ----------------------------------------------------------------------------- package com.antair.blackberrylib.ui; import net.rim.device.api.system.Application; import net.rim.device.api.ui.Screen; import net.rim.device.api.ui.Ui; interface ScreenChangerListener { void onScreenChangeComplete(Screen openedScreen, Screen closedScreen); } final class ScreenChanger { static void change ( Screen screenToOpen, ScreenChangerListener listener ) { ScreenChanger.change(screenToOpen, null, listener); } static void change ( Screen screenToOpen, Screen screenToClose, ScreenChangerListener listener ) { Application.getApplication().invokeLater( new EventThreadScreenChanger(screenToOpen, screenToClose, listener)); } static void close ( Screen screenToClose, ScreenChangerListener listener ) { Application.getApplication().invokeLater( new EventThreadScreenChanger(null, screenToClose, listener)); } } final class EventThreadScreenChanger extends Thread { Screen _screenToOpen; Screen _screenToClose; ScreenChangerListener _listener; EventThreadScreenChanger ( Screen screenToOpen, Screen screenToClose, ScreenChangerListener listener ) { _screenToOpen = screenToOpen; _screenToClose = screenToClose; _listener = listener; } public void run() { if ( _screenToOpen != null ) { try { Ui.getUiEngine().pushScreen(_screenToOpen); } catch ( Exception e ) { // Your error handler } } if ( _screenToClose != null ) { try { Ui.getUiEngine().popScreen(_screenToClose); } catch ( Exception e ) { // Your error handler } } if ( _listener != null ) { _listener.onScreenChangeComplete(_screenToOpen, _screenToClose); } } }
Your marketing engine.
People call it a “marketing engine”, thinking that the company has control of the throttle, when really, it’s the customers, and the company is just along for the ride.
The best you can do is build something useful and stable, point it in the right direction, and hope for the ride to last you a while.
My hope for the 2011 mobile market
I hope that the mobile marketplace begins to show some glimpse of maturity. But stabilization is impossible without recognition that declining price points and emergence of hit-based economics are detrimental to software companies seeking a sustainable business model for long-term growth.
… 21 luminaries offer their hopes for the mobile industry in 2011
Holiday and Young, 1957.
One of the finest things you will ever watch.
If a messy desk is the sign of a messy mind …
“If a messy desk is the sign of a messy mind, then, what is an empty desk a sign of?”
My video interview with Untether.tv
Clear-cut pricing in the 1930′s
Smart retailers always understood the benefits of clear-cut pricing. Even during the depression.

(image from Ken Burns’ Jazz)
A long road indeed.
Came across this blog post from last year. Found the stack trace mesmerizing, and more than a little disturbing.
The stack trace for a J2EE web app call — from the initial web server request to the final database call.
Just look at it! And that’s just the one way trip.

Introducing Antair Headers
Today, we released a new tool for BlackBerry users. We call it Antair Headers, and it allows you to view the full e-mail headers of any e-mail message on your BlackBerry.
We’re making this application free of charge for everyone. Compliments of Antair. Enjoy.
Heavy Rain

Heavy Rain, from Quantic Dream, is, quite simply, the best video game ever made.
The visuals are absolutely stunning.
The control scheme and interaction is perfectly fluid; throwing everything that came before out of the window.
The attention to detail, from character gestures to interior design, is superb.
The amount of influence your choices have on the flow of the story is unprecedented in an adventure game.
Most importantly, the story is very deep, extremely emotionally engaging, and, without compromise, written for adults. This isn’t a game for the little ones. Firstly, they won’t get anything out of it, and secondly, there’s some nudity and other adult themes. But the adults will love it. Parents with small kids will especially feel the impact of the story line.
Forget “good for a video game”. Calling it a video game would be an insult. It is a brilliant, engaging, completely satisfying experience.
Heavy Rain is what all future adventure games should strive to be. Anything less is no longer adequate.


