Tag Archives: blackberry

Suspending Development of our BlackBerry client software for Microsoft SharePoint

On May 6, 2011, we suspended development of Pylon, a BlackBerry client for Microsoft SharePoint. This was a very difficult decision, as we started working on this product over three years ago and invested significant R&D, sales and marketing effort into it. Three issues factored into the decision:

  1. Breadth of Features: Microsoft SharePoint is a large and multi-dimensional product. As we narrowed the feature set to appeal to a few customers, we grappled with how to scale to a broader base. Enterprise SharePoint customers frequently build solutions assuming that Internet Explorer will be the user interface. Bringing these custom solutions to multiple mobile environments would require significant engineering work from both SoftArtisans and the customer.
  2. Microsoft’s SharePoint Protocol Patent Licensing, which imposes a significant royalty on a product like Pylon: By our reading, a client-only, software-only product like Pylon would require a minimum royalty payment of $5.80 per license, which is unfeasible in a typical app marketplace where products are either free or typically less than $20, not counting an app store’s 30% fees. Continue reading Suspending Development of our BlackBerry client software for Microsoft SharePoint

Setting An Automated BlackBerry Test Environment Against A Real BES: A Story Of Failure

We wanted to set up an automated testing environment for the Blackberry in which we could test against multiple versions of a real BES. We have a pretty solid framework for automated testing of OfficeWriter, and since it proved itself to be very beneficial, we decided to try to do the same for our BlackBerry product. We already have a framework in place which runs automated tests on the simulator using the MDS simulator. We even extended this framework to run against an actual SharePoint server, although that’s a topic for another blog post. So, if precedence counts for anything, setting up an automated test environment for BlackBerry should have been a snap, right? Wrong. Here I wish to describe the path we walked down as we tried to set up a test environment that would run automatically against a real BES.

Setup

In order for a simulator to run against a real BES, it needs to connect to Desktop Manager, so we have set up two (Windows 7 64bit) virtual machines, each with a simulator and a Desktop Manager set up with a user provisioned through BES – one for BES 4 and one for BES 5. In order to automatically access and control these machines we chose to use PsExec from our Ant script using the exec tag and passing in the needed arguments. So, for example the followings, as part of an Ant target, will restart MyRemoteMachine using PsExec: Continue reading Setting An Automated BlackBerry Test Environment Against A Real BES: A Story Of Failure

Using SQLite in BlackBerry Applications

We recently decided to add some basic persistence to Pylon, our latest mobile application for accessing SharePoint. Nothing complicated, just logging levels, username and SharePoint URI.

We decided to use SQLite for persistence instead of the BlackBerry Persistent Store  because of our previous experiences with the latter – where we encountered some stability issues such as the insidious 523 error which requires removing the battery to fix. We were also looking for an approach that would be more compatible when we port our application to iOS and Android.

The BlackBerry code samples for basic SQLite operations are straight-forward: http://docs.blackberry.com/en/developers/deliverables/8682/Code_samples_702046_11.jsp

However after basing our code on the samples we did run into a couple of issues.

SQLite not working on some phones – “Error: file system not ready”

The first issue we ran into was that the database simply didn’t work for certain phones. The confusing thing was that it wasn’t even consistent for phones of the same model.

It turns out the key was this line in the BlackBerry documentation:

“You can create database files in eMMC memory, on devices that support it, by specifying the corresponding file system path.”

Our application would use an SD Card if there was one, otherwise we would use device memory. If the device didn’t have an SD Card AND it didn’t have eMMC memory then we would get a “file system not ready” error when creating a database.

Phones that support SQLite DB in device memory (eMMC)

  • Torch
  • Storm 2

Phones that DON’T support SQLite DB in devicememory

  • Bold
  • Curve

Even with an SD Card, SQLite might not work if Media Card Support is turned off or if the phone is tethered to a computer and Mass Storage Mode is turned ON.

Intermittent Error – “Error: File system error (12)”

Another error we ran into was that sometimes opening the database soon after reading or writing to it would fail with the error “File system error (12)”. Just for testing I added code that would try to open the database a second time in case of failure after sleeping 100 milliseconds. This second attempt to open the database would always succeed.

Looking for “File system error (12)” online I found a few instances that were determined to be caused by bad queries or by failing to close the database or a SQL Statement. However the exact same query that worked most of the time was being called when the error would occur and after reviewing the code we determined that all databases and SQL statements were being correctly closed.

It turns out that we were following the BlackBerry examples a little too closely and opening/closing the database for every read/write operation. The overhead of this meant that the database wasn’t ready to be opened in time for the next operation.

We fixed the problem by only opening the database once the first time and then reusing that handle all subsequent times until we close the database on application exit.

Static Initialization in the BlackBerry JVM

The Problem

I was investigating some odd behavior on the BlackBerry recently to try to diagnose a problem. Along the way, I discovered a bug in BlackBerry’s JVM, as a result of which static initialization can occur multiple times – and even static final variables can change.

Consider the following code:

public class App extends Application
{
	public static void main(String[] args)
	{
		System.out.println(BaseClass.class.getName());
		System.out.println(Subclass.class.getName());
	}
}

public class BaseClass
{
	static
	{
		System.out.println("Static initialization called");
	}
}

public class Subclass extends BaseClass
{

}

Continue reading Static Initialization in the BlackBerry JVM

SSL Certificates, Blackberries, BES, and SilverDust

Introduction

Potential connection issues can occur between the SilverDust server, BES, and SilverDust blackberry client if SSL encryption is used. We recommended SSL be used in every production SilverDust environment to encrypt SharePoint content between SD Server and the BES/blackberry.

This post also serves as a general guide for accessing any SSL enabled website from the blackberry.

The Handshake

There are two ways a blackberry can complete a SSL handshake. The first option, called proxy mode, allow’s the BES to complete the handshake on a blackberry’s behalf. The second option, called handheld mode, allows the blackberry to directly complete the handshake.

Handheld Mode

To enabled handheld mode change the TLS default setting on the blackberry. This setting can be adjusted on the handheld by navigating to options->security options->advanced security options->TLS Default->change the setting between proxy and handheld. The default is proxy mode or set an IT policy value to force handheld mode. Continue reading SSL Certificates, Blackberries, BES, and SilverDust

Blackberry Swallowed My Error

In some peculiar cases there will be an error thrown somewhere in the Blackberry modules that were invoked from your coed, but the error will never return to you, even with a try-catch block set. The stack trace of the error will be printed to the console, your process will be terminated and an error message will pop up on the device/simulator screen with: Uncaught exception: and the exception name.

An example for this is the Controlled Access Exception. When trying to open a file that is access controlled, even a specific catch for this error it will not matter, the process will be killed and the error window for uncaught exception will pop up. The best practice is of course to check for access control before reaching for the file, but it still doesn’t make sense to have it swallow the error and kill the process instead of bubbling it up. Also, for the access control it’s pretty straight forward, but now I have encountered it again, with a java.lang.Error exception and the process gets killed… java.lang.Error is slightly less informative than ControlledAccess Continue reading Blackberry Swallowed My Error

Deploying a BlackBerry Application OTA in IIS

You can get an application to your BlackBerry in four different ways.

  1. (OTA -Over The Air) Host the application files on a web server and browse to them from the phone
  2. put the application files onto a SD card and load it on the device
  3. load the application onto the phone using the BlackBerry Desktop Manager
  4. push the application to the phone using the BES

There are three different types of files that you will use to install the application on your phone.

Manifest files.

You will need one or the other depending on the deployment metheod you are going with. These files hold the information on how to install the application on your phone what files are going to be needed to do that. Continue reading Deploying a BlackBerry Application OTA in IIS

How to Enable Debug Logs on Your Blackberry

Enabling debug logs on a blackberry device can help provide useful information when troubleshooting an issue.

Blackberry Storm

  1. Bring up the keyboard on your home screen by pressing the blackberry key followed by show keyboard.
  2. Hold the 123 button in until you see a small lock icon.
  3. Type in the following sequence “/”/

Other Blackberries (This hasn’t been tested on anything newer then the Curve.)

  1. On the home screen, hold down the ALT key and type the following sequence LGLG

Log display

  1. You can adjust the minimum log level under EventLogger Options by pressing the blackberry key followed by options. You can changing the level in the top drop down box.
  2. While still under EventLogger options, you can filter certain logged events by toggling them on and off.

How to save a copy of the debug log

With the EventLog screen open:

  1. Click the track wheel and select Copy Day’s Contents.
  2. Paste the contents into the body of an email and send the message to yourself.

How to Disable MDS-CS on a Per-User Basis

Any BES administrator who has migrated their BES environment from 4.1 to 5.0 can see the extensive changes made in the central blackberry management interface. I’ve found it difficult at times to find certain options in the new BAS console. Today, I was looking for the option to turn off MDS-CS for a specific user in other words I wanted to keep the user from browsing the internet/intranet from their blackberry. The MDS user component has been renamed External Services and can be found under the component information of a BES user account.

BlackBerry Simulator – *.debug File Not Found

I encountered an interesting (and frustrating issue) with the BlackBerry simulator in Eclipse. I got an error upon starting the simulator that the *.debug file was not found with some options to search and browse for it. Looking around my system showed that indeed – no *.debug files exist. I’ve tried many things, erasing all my Simulator Files, cleaning the build, re-building and so on, to nothing helped. Eventually I ran into this forum threadin the blackberry forums discussing this specific problem. It turns out that sometime, even though there are errors in the build – no errors will be shown, making you believe the build was successful. However, this is not the case. There should be an *.err file (were the *.debug file should have been) describing a compilation error in code.

Seeing that this came from the same error mentioned in the thread – _X is not Persistable: base Class does not implement net.rim.vm.Persistable_ , it might be that this specific error has a problem displaying in Eclipse.