BlackBerry – Et-Setera https://www.setera.org Ramblings of a geek Fri, 15 Nov 2013 00:56:48 +0000 en-US hourly 1 https://wordpress.org/?v=4.5.24 First ZBerry Release https://www.setera.org/2009/09/07/first-zberry-release/ https://www.setera.org/2009/09/07/first-zberry-release/#comments Mon, 07 Sep 2009 23:35:12 +0000 https://www.setera.org/?p=204 I have just made available the first public release (version 0.5.0) of the ZBerry interactive fiction application.  This release works pretty well, but is definitely rough around the edges.  I hope people get some amusement despite any bugs.  More details about installation and usage can be found on the ZBerry Documentation page.

ZBerry Game Play

ZBerry Game Play

Please take this for what it is worth… a silly little hobby project of mine that may or may not continue.  If you really like this, feel free to comment.  If you find bugs, source code patches are welcome, but complaints are not.  My hope is that is that it is worth more than its price (FREE) but given that I’m making nothing from this I hope that everyone can understand there is absolutely no support implied or available.

]]>
https://www.setera.org/2009/09/07/first-zberry-release/feed/ 3
Snow Leopard And BlackBerry Tethering https://www.setera.org/2009/09/07/snow-leopard-and-blackberry-tethering/ https://www.setera.org/2009/09/07/snow-leopard-and-blackberry-tethering/#comments Mon, 07 Sep 2009 21:15:17 +0000 https://www.setera.org/?p=201 I have been told that the replacement Macintosh BlackBerry PPPD is no longer necessary for systems that have Snow Leopard installed.  In fact, it sounds like installing the patched pppd version can actually cause issues on Snow Leopard systems.

If you have Snow Leopard on your system, please do not install the patched version of PPPD.

I will keep the replacement package available for those like myself that are still running Leopard on their systems.  In addition, there is a version built for Tiger.

]]>
https://www.setera.org/2009/09/07/snow-leopard-and-blackberry-tethering/feed/ 2
BlackBerry Tethering with 10.5.8 https://www.setera.org/2009/08/11/blackberry-tethering-with-10-5-8/ Tue, 11 Aug 2009 17:49:00 +0000 https://www.setera.org/?p=164 Just a quick post to validate that the latest Leopard update (10.5.8)  overwrites the changed pppd provided by my replacement package.  I’ve also verified that installing the replacement package on top of 10.5.8 works just fine.

]]>
Cool BlackBerry API Support https://www.setera.org/2009/07/21/cool-blackberry-api-support/ Wed, 22 Jul 2009 00:23:19 +0000 https://www.setera.org/?p=157 In my last post, I was pretty negative about the available BlackBerry user interface controls.  While that fact hasn’t changed, I didn’t want to leave the impression that the BlackBerry API’s provide nothing to developers.  The API’s provide lots of interesting functions including the ability to extend menus within other applications.  Take a look at the following from the default messaging application on a 4.5 device.

Before Facebook Installation

Before Facebook Installation

This shows the menu in this application before installing the Facebook application.  After installation, you can see that the Facebook application has added a new menu item to this application.

After Facebook Installation

After Facebook Installation

This is a pretty nice feature of the API.  Although I don’t have actual code to show for this, my assumption is that this is provided by using:

API’s like this allow for incredible integration with the rest of the applications on the device, opening up many very interesting opportunities.

]]>
The Woeful State of BlackBerry UI Controls https://www.setera.org/2009/07/13/the-woeful-state-of-blackberry-ui-controls/ Tue, 14 Jul 2009 02:12:59 +0000 https://www.setera.org/?p=138 I continue to be impressed with the build quality and overall polish of the BlackBerry Bold as an end-user device… at least for basic functionality.  While some may not like the way BlackBerry push email works, I find it to be pretty nice.

As a developer, I’m much more disappointed developing using the BlackBerry native API than I expected I would be when I started playing with my little ZBerry project.  Marcus Watkins offers excellent insight into the world of BlackBerry development, which I won’t try to rehash here.  The part that I find incredibly frustrating is the lack of decent reusable user interface controls.  As Marcus details in his blog post, the provided UI functionality has the bland look and feel of the base operating system.  Even more frustrating to me is how little flexibility there is even within the standard controls.  For instance, I wanted to provide the user the ability to customize the font used in the text display.  Using the standard functionality yields the following dialog.

Initial Fonts Dialog

Initial Fonts Dialog

Wow, look at the size of that dialog relative to the screen.  All of that wasted space.  So much space could be saved if:

  • The extra space between the label and field contents wasn’t there.
  • The OK/Cancel buttons were laid out horizontally instead of vertically.

What’s worse is that the, while the change listener support attached to those fields is capable of updating the story font on the fly, the user can hardly see the text.  Thinking there had to be a way to control things a little bit better, I tried to turn off the label text.  If I could lay out the two fields side-by-side, it might be better.  Unfortunately, there appears to be no way to do that.  Setting it to blanks yields a dialog that is even a bigger waste of space.

Font Dialog Attempt #2

Font Dialog Attempt #2

Given that there is vertical and horizontal layout field management, why must the label and text field be tied together like this?  I’m sure some of it boils down to legacy hardware support for things like the trackwheel.  But it would be nice to be able to selectively break free of those restrictions.

While the API would certainly allow me to build a version of these controls from scratch, that seems a silly thing to have to do.  Doing so implies the need to account for the various input options (trackwheel, trackball, keyboard, etc), do all of the rendering and focus management that these controls are already handling.  Admittedly, this is still an issue of “look and feel”, but it is disappointing to see something so simple be neglected.

With that said, the text input and output controls are pretty impressive, saving effort on that side of the implementation.  I guess it should come as no surprise that the strongest parts of the BlackBerry API revolve around features such as email that have been in the platform for a very long time.

Marcus Watkins

]]>
ZBerry Story Library https://www.setera.org/2009/06/21/zberry-story-library/ Mon, 22 Jun 2009 00:18:40 +0000 https://www.setera.org/?p=122 I’ve decided to dub this little hobby project ZBerry (BlackBerry Z-Machine Interpreter).  I made some progress this weekend allowing stories to be selected from the file system via a new “library” view.

ZBerry Library Selection

ZBerry Library Selection

I need to add some suspend/resume support before this thing becomes really very usable on a phone, but some progress anyway…

]]>
BlackBerry drawText Alignment and Anchors https://www.setera.org/2009/06/15/blackberry-drawtext-alignment-and-anchors/ Tue, 16 Jun 2009 02:10:55 +0000 https://www.setera.org/?p=80 I was recently struggling to understand how to text alignment works with the BlackBerry Graphics drawText function.  Having developed for MIDP on JavaME for a number of years, I found that the way the BlackBerry API works is a bit counter-intuitive until you understand how it works.  I expected that this code would work, based on JavaME:

protected void paint(Graphics graphics) {
// Stash the current colors and invert them for the
// background fill
int currentBgColor = graphics.getBackgroundColor();
int currentFgColor = graphics.getColor();
int w = getWidth();
int h = getHeight();

graphics.setColor(currentFgColor);
graphics.fillRect(0, 0, w, h);

graphics.setColor(currentBgColor);
graphics.setBackgroundColor(currentFgColor);

// Draw the pieces of text
int midHeight = h / 2;
int midWidth = w / 2;
buffer = new StringBuffer();
buffer.setLength(0);
buffer.append(“Moves: “).append(moves);
graphics.drawText(
buffer, 0, buffer.length(), w, midHeight, Graphics.VCENTER | Graphics.RIGHT, w);

buffer.setLength(0);
buffer.append(“Score: “).append(score);
graphics.drawText(
buffer, 0, buffer.length(), midWidth, midHeight, Graphics.VCENTER | Graphics.HCENTER, w);

graphics.drawText(statusText, 0, midHeight, Graphics.VCENTER | Graphics.LEFT);
}

I had expected three pieces of text, aligned right, left and center.  Instead, I ended up with:

Broken Text Alignment

Broken Text Alignment

The Graphics#drawText methods look similar to:

public int drawText(StringBuffer text,
int offset,
int len,
int x,
int y,
int flags,
int width)

The trick with this API has to do with that last parameter.  The width parameter is used to define a bounding box.  The x and y parameters define the top-left corner of that bounding box.  Horizontal alignment flags (HCENTER and RIGHT) do the alignment relative to the bounding box defined by (x, y, x + width, y + height).  To get the same behavior I had expected, I needed to set the bounding box to include the complete width and then specify those alignment flags.  The correct code now looks more like the following:


protected void paint(Graphics graphics) {
// Stash the current colors and invert them for the
// background fill
int currentBgColor = graphics.getBackgroundColor();
int currentFgColor = graphics.getColor();
int w = getWidth();
int h = getHeight();

graphics.drawText(
statusText,
padding,
midHeight,
Graphics.VCENTER | Graphics.LEFT);
}

graphics.setColor(currentFgColor);
graphics.fillRect(0, 0, w, h);

graphics.setColor(currentBgColor);
graphics.setBackgroundColor(currentFgColor);

// Draw the pieces of text
int midHeight = h / 2;
int paddedWidth = w – (2 * padding);

buffer = new StringBuffer();
buffer.setLength(0);
buffer.append(“Moves: “).append(moves);
graphics.drawText(
buffer,
0,
buffer.length(),
padding,
midHeight,
Graphics.VCENTER | Graphics.RIGHT,
paddedWidth);

buffer.setLength(0);
buffer.append(“Score: “).append(score);
graphics.drawText(
buffer,
0,
buffer.length(),
padding,
midHeight,
Graphics.VCENTER | Graphics.HCENTER,
paddedWidth);

}

This results in expected text layout:

Correct Text Alignment

Correct Text Alignment

]]>
Interactive Fiction on Blackberry https://www.setera.org/2009/06/14/interactive-fiction-on-blackberry/ Mon, 15 Jun 2009 01:11:24 +0000 https://www.setera.org/?p=107 I have long had a strange fascination with the old text adventure games aka interactive fiction.  I remember hanging out with my buddy Gary when we were kids, working our way through various Infocom games.  The stories were fun and the puzzles were always a good way to make you think.

A few years ago, I created a JavaME MIDP Z-Machine interpreter called ZeeME.  This was an interesting little project at the time to learn my way around programming for these small devices, but actually using it was painful at best.  Typing natural text using triple-tap just wasn’t enjoyable.  With a QWERTY keyboard on my BlackBerry Bold, it seemed like this might be a good time to resurrect this project yet again.

I’ve made some progress in building this out, but there is still a very long way to go.  Here’s a snapshot of the emulator running the game “Minizork”.

minizork

Watch here for more to come…

]]>
BlackBerry Bold Bluetooth Tethering https://www.setera.org/2009/05/31/blackberry-bold-bluetooth-tethering/ Mon, 01 Jun 2009 00:53:50 +0000 https://www.setera.org/?p=72 I recently did a bit of fighting with the Macintosh pppd daemon to fix problems with Bluetooth tethering of my BlackBerry Bold.  Downloads, installation details and more information can be found in BlackBerry Bold PPPD Replacement.

]]>