Learning to write Java apps for the BlackBerry

22 April 2010 » BlackBerry, Java, Potpourri

Early in 2009 I decided to start writing Java applications for BlackBerry devices.

I’ll tell you why I chose this particular smartphone platform and how three books that I later received as review copies from Apress can help you get started too.

I’ll also share some thoughts on a gap I see in the BlackBerry developer’s bookshelf.

BlackBerry leads US smartphone market share
With the Apple iPhone garnering all the the mobile application exposure, it’s easy to see why RIM’s BlackBerry devices get less developer attention these days.

However, BlackBerry devices still hold a larger share of the smartphone market than either the iPhone or Android devices.

According to comScore, RIM comprises about 40% of devices sold, with Apple at 25% and Google at around 10%. The iPod and iPad aren’t included in this category, of course.

Other reasons I chose to develop for the BlackBerry platform
Besides the sizable marketshare, there are three major reasons that I’ve been learning to build BlackBerry apps over the past year or so.

  • My wife and I have owned several personal BlackBerry devices over the years and continue to use them daily.
  • Java development is a major part of my day job and it’s nice to reuse those skills on a new platform.
  • I work for a company that uses the BlackBerry Enterprise Server to manage its mobile workforce and therefore I already have a sizable audience of users to target for new projects beyond standard Web applications.

Where to start?
When I started learning about the BlackBerry platform there weren’t that many recent books on the market, which surprised me.

Instead, I needed to learn what I could through trial and error and the help of the large, but somewhat disjointed, collection of official documentation from RIM on the BlackBerry Developer Zone.

While there is a lot of material there, it’s hard to understand what’s most relevant and up-to-date, and what sort of roadmap the beginner should follow to learn the platform given those resources.

Getting started gets much easier
Fortunately, the BlackBerry book landscape has improved in the past few months, but the number of new releases still pales in comparison with the glut of iPhone development titles on the market.

I’ve had a chance to work through a few of these new books, two of which Apress provided me for free as review copies, and another that I have access to via Books24x7 thanks to my place of employment.

I suppose it’s only slightly ironic that as I read the latter book online, I wished I had an iPad to curl up with rather than a run-of-the-mill laptop or smartphone. :)

Apress book overview
By all indications, Apress has emerged as the leading publisher of BlackBerry books in late 2009 going into 2010. In particular, the first title below is one that would have saved me a lot of time when I got started early in 2009.

In any case, I can recommend any of these books, but obviously they all have their own target audience and don’t necessarily need to be read in sequence.

Also, keep in mind that these books focus on the development of native Java applications rather than tailoring Web sites to the BlackBerry browser.

  • Beginning BlackBerry Development by Anthony Rizk.
    This book provides an excellent introduction to the key topics that most interest a Java developer new to the platform.

    It covers the basics of setting up an IDE, putting together a user interface, using local storage, making network connections, using GPS, and distributing your application. All the steps are approached in an easy to follow tutorial format.

    The fact that Anthony Rizk was a founder of Rove Mobile – which produces the admin tools I depend on on my BlackBerry – lends this book extra credibility.

  • Advanced BlackBerry Development by Chris King.
    This book covers some of the same ground as the title above but takes a deep dive into audio and video development, text and email messaging, encryption and access control, and integration with the BlackBerry operating system and its built in applications such as the Address Book, Calendar, and Browser.

    It also provides valuable lessons on packaging your application for many different BlackBerry models and carriers and automating the build, versioning and deployment processes.

  • Learn BlackBerry Games Development by Carol Hamer and Andrew Davison.
    While this book’s subject matter has less in common with the type of business applications I write, it was an interesting read.

    Some of the compelling chapters include information on using Antenna for builds, using OpenGL ES and JSR 239 for 3D graphics, and how to license, release and commercialize your application.

    There’s even a thoroughly geeky chapter on using a BlackBerry connected to a PC via BlueTooth to drive a toy car attached to the computer by USB.

What’s also nice about these books – and what sets them apart from the official RIM documentation – is that they are pretty straightforward about the limitations of the platform and can be quite frank with their assessments of certain capabilities.

What I’d like to see in upcoming books
I set a goal for myself to deepen my BlackBerry skills this year. One of the best ways that I’ve found to thoroughly understand a platform – even one that you’ve been using for years – is to attempt certification or at least know the study materials inside-and-out.

RIM has recently introduced a certification program in order to achieve the BlackBerry Certified Application Developer credential via Java or Web development tracks.

Given how new the exams are, there aren’t yet any guides on the market to help the candidate pass both exams needed for certification.

Addison Wesley’s BlackBerry Development Fundamentals by John M. Wargo claims to be a good guide for the prerequisite exam (BCP-810), but does not cover the second exam on either Java (BCP-811) or Web development (BCX-812, understandably, which is still in beta).

Given that RIM’s study guides are so sparse, I see a great opportunity for any publisher to hit the market with a certification guide on these two exams in 2010.

Final thoughts
If you’re looking to get into Java development for BlackBerry smartphones, I recommend you at least have a look at Beginning BlackBerry Development.

Of course, supplement your learning by staying on top of news from the BlackBerry Developer’s Blog and of course the BlackBerry Developer Zone.

If you find the platform interesting, have a look at either Advanced BlackBerry Development or Learn BlackBerry Games Development.

Finally, I recommend you keep an eye out for news from the WES conference next week. I hope RIM gives developers even more compelling reasons to look at the BlackBerry platform.

Easter egg in the AIX InfoCenter

01 April 2010 » IBM, Potpourri, System administration

I had to double check the calendar when I first saw this gem in the AIX online documentation yesterday, but it was still March, not yet April first.

AIX 6.1 information > Commands > Categorical list of commands

Purpose: Starts the hunt the wumpus game.
Syntax: wump
Description: A wumpus is a creature living in a cave with many rooms interconnected by tunnels. You move among the rooms trying to shoot the wumpus with an arrow and trying to avoid being eaten by the wumpus or falling into bottomless pits.

As far as I can tell, this command is a hand-me-down from when the System V UNIX-based AIX incorporated bits from BSD.

I suppose this and the other games are still there for those customers using AIX on workstations (rather than bored sysadmins monitoring high-end servers… I hope).

DHS: Preserving our Freedoms, Protecting America, Sharing Files

21 October 2008 » Music, Politics, Potpourri

I saw this interesting entry in my Web server logs today. It looks like the folks at the Department of Homeland Security may have some time on their hands to share their iTunes libraries among coworkers.

While it’s nice to see they have the spare hardware and bandwidth to set up an enjoyable working environment at the bureau, I worry about the threat posed by a malicious audio file introduced to their internal network.

Lets have a look at something United States Secretary of Homeland Security Michael B. Chertoff said last week, on the occasion National Cyber Security Awareness month:

Question: I just want to ask you what DHS has done to protect the information that the private sector is supplying to DHS through online systems. I am asking this because I am interested in the information that high-risk chemical facilities have submitted to you through your online system and how do we know that that information is secure.

Secretary Chertoff: Generally, we do pay a lot of attention to securing our own systems. I am happy to say a grade that government — I hate it when they grade you, I figured I was done with this in elementary school. It is worse in Washington because people that grade you are often — it is like the parent of your competitor. We do get graded on our security systems and I do think a few years ago we were getting a low grade, two years ago we got a D, last year we got a B+, this year our internal security systems are going to be better than last year’s.

I think we are getting our own house in order, but in a larger sense by reducing the number of entry points to the domains and by putting in a more robust set of protections for detections and prevention, that is going to protect our data.

Of course, this all assumes that the rogue Googler was intending to find instructions on how to set up a system at work, as opposed to doing some personal research for his network at home, but it raises questions nonetheless.

Oh well, at least according to my logs they have their own secure build of Internet Explorer 6…

Ultimate Fighting Cats

19 January 2008 » Cats, Potpourri

I recently dug up the following set of notes for a video Web site I was planning a little over 2 years ago. I brainstormed a bit, but in the days before YouTube, I didn’t think the video encoding, storage or bandwidth needs would be feasible.

I still think it’s a fun idea with a lot of potential. Whether I ever find the time to put it together, I don’t know. In the meantime, enjoy…

Editor’s note: the cats are now six and we all live in a house in Bridgeport, CT.

Between working from home three days a week and moving from a two-bedroom apartment to a studio, I’ve begun to really take notice how often my two cats have at it during the day.

I’m using this site to prove my hypothesis that despite her smaller size, Tarball normally wins the fights. It’s also my belief that Tahoma picks most of the fights.

The contenders
Tahoma and Tarball are a pair of 4 year old siblings that I adopted from New Yorkers for Companion Animals when I lived in Manhattan. Tarball is a 7lb solid black female. Tahoma is an 8lb male tabby. Both hail from Queens, NY. Both now reside in Stamford, CT.

The battles
Most battles only last about 3 minutes, and end when one of the contestants runs away, either out of boredom, hunger, or exhaustion. They never draw blood, and their tails never fluff out, so despite the intensity, no one is hurt and I know they are playing.

It’s my general feeling that Tarball wins these battles, but I’ve come up with a scoring system to confirm that. Since most battles seem to start when both cats are sleeping peacefully (1, 2, 3) on my bed, and one shifts position which annoys the other, I will consider the “ring” to be my full-size bed.

Maneuver Points
Successful swat to face 1pt
Takedown 3pts
Bite to neck 5pts
Out of ring 8pts
Chasing takedown 10pts
Face-kick hold (you know what I’m talking about) 15pts

Result tally
For every given battle, the following information should be tracked for statistical purposes.

Battle information Value
Start of fight ___
Location ___
Duration of fight ___
Winner ___
Points ___

Rate this battle
One to five stars.

Pictures and video
Thumbnails, all time best battles, highlight montages.

All married up and honeymooned out

17 December 2007 » Potpourri, Travel

Ah, so it’s been close to two months since I last posted, but I have a good excuse.

Cat and I were married on November 24th, the Saturday after Thanksgiving in Tarrytown, New York. We were thrilled that so many of our friends and family could travel so far or otherwise be there on the holiday weekend. It meant a lot to us.

Our excellent photographers Justin and Mary have posted a few teasers up on their blog – we can’t wait to see how the rest came out. This shot in particular sums up both their creativity and their drive to know their clients ahead of the big day. We’d recommend them without a moment’s hesitation.

Our mutual friend and former colleague Jen König posted a pair of beautiful pics on Flickr as well; Cat’s mom lighting the unity candle during the ceremony and our entrance at the reception.

Speaking of Flickr, I finally broke down and signed up for an account to post close to 600 of the “best” shots from our honeymoon in New Zealand. It’s hard to believe that even that many is a mere quarter of the 2112 shots we took :)

A new tonneau cover for the Frontier

14 August 2007 » Photos, Potpourri, The truck

This past weekend I installed a hard tonneau cover on my Nissan Frontier pick-up truck. I had been meaning to do it for quite some time, but choosing the right cover has been a challenge.

Nissan sells both a factory hard tonneau and a soft cover tonneau but neither is cheap nor easy to install and remove. The many independent hardware vendors sell hard and soft covers which never quite fit my needs.

After several fits of research over the years, I found a company called Lazer Lite that makes a nice hard aluminum cover which opens with the help of a pair of hydraulic struts. It also removes easily and doesn’t take up much room in the bed itself.

Cat ordered one for me as a surprise for my birthday, and although it took a while for Lazer Lite to build and ship, I’m pretty damn happy with the cover and the customer service we received.

If you’re in the market for a tonneau, I highly recommend Scott and the folks at Lazer Lite.

Here’s some before and after pics of the cover on my truck.

On cruft, or, channeling Lao-Zi

I discovered this insightful nugget over on Slashdot.

It was posted in response to a disillusioned “Ask Slashdot” submitter pondering whether such a thing as “Pretty Code” exists.

Cruftiness is the quality of having cruft. Cruft is the stuff that accumulates on code over time. Cruft has no odor, but it stinks. Cruft has no mass, but it weighs the code down. Cruft can’t be seen, but it’s ugly. Cruft cannot be young, it’s always old. Cruft can’t be deliberately added, it only appears when you’re not looking.

Cruft can’t be explained to managers, except through awkward car analogies. They still won’t get it because managers drive well-maintained elegant foreign cars like BMW’s, which gather no cruft. Programmers understand, because their Fords and Chevys are practically built of cruft. Harley motorcycles should have cruft, but noise dissipates cruft. Cruft is mysterious.

Cruft is never present on code which hasn’t had enough work. Cruft only appears on code which has been worked too long, by too many people.


Time for another Godzilla remake

16 July 2007 » Potpourri

Tragic of course, but this is how great movies are born.

A small amount of water containing radioactive substances leaked into the sea, officials said, and a fire broke out at the plant in Kashiwazaki.

Uchino said the water contained a tiny amount of radioactive material — a billionth of the guideline under Japanese law — and is believed to have flushed into the Sea of Japan.

Next page »