was successfully added to your cart.
Category

BlackBerry

A Mobile Developers Guide

By | Android, BlackBerry, iPad, iPhone, Mobile Development, Uncategorized, Windows Phone 7

App design is a thorny problem for most people. This is doubly true on mobile devices, where maintaining a sleek, user-friendly interface is trickier than it looks. Thankfully, there is a wealth of information on this subject, making it just a bit easier to decide on what an app should look like.

First is the  iPhone and Android site http://www.mobile-patterns.com/. Consisting of a gallery of the most successful apps (including Twitter, Instagram, Facebook etc), this site contains a list of categories that may be giving you problems. This list contains a handy menu of the most common features in apps, such as Lists, Camera Controllers and the like. Each page contains images of examples in practice, providing guidance on how to achieve a similar effect in apps currently being worked on.

Second is the iPhone only site http://pttrns.com/, which provides a similar service to the above site, albeit focused on iPhone. Apart from the magnifying glass enabling your cursor to see up close to the images, it’s all pretty similar to the site above. Where it differs though is selecting an image that you like doesn’t just display the image in a fuller size. Instead it takes you to all images listed on the site under the same app, along with a link to the iTunes website and ratings for the app.

Apart from the above sites, there exists a host of other sites in a similar vein. These include dribbble.com, www.lovelyui.com and www.androidpatterns.com. Sadly, these are all related to Android and iPhone, and I have been unable to find a site for BlackBerry devices. Thankfully, the BlackBerry site contains tips on how to create a standardised UI across BlackBerry devices. How to implement these features in code is a whole different problem. Hopefully I will address that in a future update!

Johann Van den Bergh

Mobile Software Developer

Cobi Interactive

Deploying a BlackBerry app for OTA installation

By | BlackBerry, development | No Comments

When testing a build of a BlackBerry app, one method to deploy the app on a BlackBerry OTA is to host all of the application COD files and a main JAD file with the relevant details of each COD file in it. Once hosted, one can point the BlackBerry device to the JAD file being hosted and the application COD files will be installed on the device.

While this isn’t such a problem with single projects in isolation, anyone who has had to do this manually where multiple projects (such as library projects) are involved in the deployment of a single app, will known that the process of assembling the COD details into a single JAD file is rather menial and in general quite insufferable. Fortunately, the BlackBerry JDE comes with a tool called updatejad.exe and works as follows:

Let’s use a main project name of Peanut and peanut relies on the library projects Raisin and Salt. To assemble the Peanut.jad file with the COD details of all the projects, one can use the following command:

updatejad.exe Peanut.jad Raisin.jad Salt.jad

I find it easiest just to copy the necessary JAD and COD files to a single directory when running this command. There you go… you now have a deployable JAD file to host along with all of the application COD file 🙂

BlackBerry: Catering for multiple OS versions with a single code base.

By | BlackBerry, development | One Comment

One of the challenges involved with BlackBerry development is the need to produce code that is able to cater for a variety of devices, running different OS versions and with differing screen sizes. In an ideal scenario, one would want a single code base that can be built against different BlackBerry OS versions, if needs be. A problem begins to emerge when one needs to access an API which doesn’t exist in some of the OS versions you are targetting… clearly, if it doesn’t exist to your compiler, it won’t build. Whilst BlackBerry has support for Java reflection – the mechanism to dynamically obtain a class at runtime by the use of the class name – the support is basically limited to only class loading…. one cannot actually call actions/methods on the loaded class dynamically.

I’ve just recently come across this issue where I needed to access a class introduced in 4.7, but my code base was building against 4.5. My specific problem was that I needed to restrict the orientation of my application, however, the class allowing me to do so was only introduced in 4.7. Instead of having to create two separate projects to build against different versions, I came across a solution here which allowed me to target different versions from the same code base. Essentially the solution relies on preprocessor compiler directives to dictate which pieces of code ultimately get compiled.

As a quick example of how something like this will look in code, I’ve included the piece of code that enabled me to restrict the orientation of my application (using a class from 4.7) within the same code base that is also built against 4.5.

private void setOrientations()
{
//#ifndef JDE_4_7_0
/*
//#endif
int directions = Display.DIRECTION_NORTH;
Ui.getUiEngineInstance().setAcceptableDirections(directions);
//#ifndef JDE_4_7_0
*/
//#endif
}

The directive JDE_4_7_0 will need to be defined in the project application descriptor when building against 4.7 – for full configuration instructions, see the previous link posted. What you will notice from the above code is that when the directive is not defined (in my case when building against 4.5), the piece of code is commented out and as a result the 4.5 compiler will never complain about the code that was only introduced in 4.7.

Obviously, this type of setup can become very messy if used excessively; however, I think it is a great solution for simple pieces of code when one needs to access APIs in different OS versions from the same code base 😉

BlackBerry Dev is Horrible: reason 4

By | BlackBerry, Mobile Development, Rant | No Comments

Take a look at the BlackBerry API reference tool-tip above – the descriptions of the url and cookie parameters have just been left blank. Fortunately in this case the parameter names make their use self-explanatory, but in other areas of the API reference this kind of incomplete or often poorly described documentation makes development more difficult than it needs to be. How hard can it be to ensure that the API reference docs are complete?

BlackBerry Developer Day – Johannesburg 2010

By | Apps, BlackBerry, development | No Comments

I was fortunate enough to attend the BlackBerry developers day conference in Johannesburg yesterday. The basic idea behind these conference days is to allow RIM to meet up with the local community of BlackBerry developers and to discuss new features and future prospects of the BlackBerry platform.

Despite a recent spate of negativity and pessimism surrounding RIM’s decision for an evolutionary  – rather than a revolutionary – approach to its OS in order to compete with the likes of iOS, Android, etc. it was immediately clear from the day’s agenda and the initial overview that RIM is genuinely excited and 100% behind the BlackBerry 6.0 OS release. Whether or not the excitement is completely justified or not, one very important signal coming from all of this is that RIM is putting in a substantial effort to improve conditions for its developers, not only from a new features and APIs point of view but also technical documentation and online code samples; this can only be a good thing going forward.

As part of the agenda, BlackBerry covered a wide array of new improvements coming from their latest OS releases. Of the topics discussed, I found the following most interesting:

  • RIM is making a big push to encourage developers to forget about targetting pre 5.0 releases with new development and to rather focus on 5 and 6 releases onwards. Their main argument for this comes from OS statistics showing that the OS 5 release alone is being used by more subscribers (around 38%; see pie chart below) when compared to the previous OS versions individually. RIM also argue that subscribers are upgrading (software and devices) rapidly and the 5.0 slice will continue to grow from day to day. I also think that this push by RIM reflects in some way as a self-acknowledgement of the unfriendly environment that pre OS 5.0 releases have provided its developers. I found this quite interesting being in South Africa and I’m not sure if I entirely agree with RIM here. Yes, the 5 OS update is a significant improvement, however, I’m not sure if it is in the best interests of developers to neglect pre 5 OS releases,  considering the following: 1) the combined subscriber count of the 4.5 – 4.6.1 releases still outnumbers that of the 5.0 release; 2) OS updates reaching the end user are carrier dependent; and 3) the BlackBerry Curve 8520 – which has been mega in South Africa – still runs a pre 5.0 BlackBerry OS.

  • BlackBerry are set to release APIs for use with their BlackBerry Messenger Service (BBM). The APIs will allow applications to build functionality on top of the already extremely popular IM service. Some of the functionality includes embedding chat within an application and sharing content amongst users. Essentially, this will allow developers to integrate the social platform provided by BBM into their applications.
  • New APIs and components available to BlackBerry OS 6.0. Without going into too much detail here, several new APIs, UI components, and the ability to tightly integrate an application with the OS (something referred to as a “Super App”) were explained at the conference.
  • Fragmentation. The issue of fragmentation amongst the BlackBerry OS versions and devices was flagged as a concern for the future prospects of the platform. I’m not really certain how BlackBerry are going to get around this, particularly as their devices cover such a wide range of the market audience. It also doesn’t help that their new tablet – the BlackBerry PlayBook –  will be running an entirely different operating system in QNX.

All in all, the conference day was a success and a first step towards growing a stronger local developer community. RIM is putting a tremendous amount of faith in their OS 6.0 release to help them grow their smartphone market share against some stiff competition. Let’s wait and see…. time will tell 🙂

BlackBerry is Horrible: Reasons 2 and 3

By | BlackBerry, Mobile Development, Rant | No Comments

These two go hand in hand so thought I’d post them together:

2: BlackBerry’s almost always seem to require a restart when you update or install over an app or library. BlackBerry’s take possibly the longest of all devices to restart. As one forum poster put it: “If I have to reboot mine I go and take a nap or read War and Peace.” This makes testing on the device a wonderful experience.

3: BlackBerrys seem to have a single class loader, but no unique namespace assigned to each app. This means that you can’t have two classes of the same name loaded at once. So if two apps use the same package / class name or if you want to build seperate instances of a shared library for multiple apps…well…you can’t without the pain of refactoring. If you try to load multiple classes of the same name, the device doesn’t complain, it just seems load the first class and quietly forgets about the 2nd one. In practice this can make developing, testing and releasing apps for BlackBerry a nightmare in certain but fairly commen circumstances.

These issues were pointed out as far back as 2006 by worried developers; and now 4 years on, the problem’s still seem to exist.

Go BlackBerry.

BlackBerry Development is Horrible in So Many Ways: Part 1

By | BlackBerry, Mobile Development, Rant | No Comments

As much as BlackBerrys are reasonably sturdy devices when it comes to simple access to various communication channels (albeit doing it with the most profoundly boring interfaces ever); their weak attempts to lure developers away from iPhone and Android are extremely frustrating; as is their development environment. After developing for BlackBerry for a year now, I’ve come across one too many flaws in the BlackBerry dev environment and programs and need to vent – this could be a long series of posts…

First up is a look at their very average website – I’ve only ever had this error happen on the BlackBerry website…numerous times…and yes I have cookies enabled.